diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 85f846b0f62f1..c8d22a9c4f35f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -384,6 +384,7 @@ com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securitydevops;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-cdn-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 2c84021679677..ffa87423332de 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ sdk/billing sdk/boms sdk/botservice + sdk/cdn sdk/changeanalysis sdk/cognitiveservices sdk/commerce diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md b/sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md new file mode 100644 index 0000000000000..8c60c3c908313 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-11-03) + +- Azure Resource Manager Cdn client library for Java. This package contains Microsoft Azure SDK for Cdn Management SDK. Cdn Management Client. Package tag package-preview-2022-11. 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/cdn/azure-resourcemanager-cdn-generated/README.md b/sdk/cdn/azure-resourcemanager-cdn-generated/README.md new file mode 100644 index 0000000000000..1e46578d25f62 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Cdn client library for Java + +Azure Resource Manager Cdn client library for Java. + +This package contains Microsoft Azure SDK for Cdn Management SDK. Cdn Management Client. Package tag package-preview-2022-11. 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-cdn-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-cdn-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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +CdnManager manager = CdnManager + .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/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md b/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md new file mode 100644 index 0000000000000..41ed9a2b419a1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/SAMPLE.md @@ -0,0 +1,3310 @@ +# Code snippets and samples + + +## AfdCustomDomains + +- [Create](#afdcustomdomains_create) +- [Delete](#afdcustomdomains_delete) +- [Get](#afdcustomdomains_get) +- [ListByProfile](#afdcustomdomains_listbyprofile) +- [RefreshValidationToken](#afdcustomdomains_refreshvalidationtoken) +- [Update](#afdcustomdomains_update) + +## AfdEndpoints + +- [Create](#afdendpoints_create) +- [Delete](#afdendpoints_delete) +- [Get](#afdendpoints_get) +- [ListByProfile](#afdendpoints_listbyprofile) +- [ListResourceUsage](#afdendpoints_listresourceusage) +- [PurgeContent](#afdendpoints_purgecontent) +- [Update](#afdendpoints_update) +- [ValidateCustomDomain](#afdendpoints_validatecustomdomain) + +## AfdOriginGroups + +- [Create](#afdorigingroups_create) +- [Delete](#afdorigingroups_delete) +- [Get](#afdorigingroups_get) +- [ListByProfile](#afdorigingroups_listbyprofile) +- [ListResourceUsage](#afdorigingroups_listresourceusage) +- [Update](#afdorigingroups_update) + +## AfdOrigins + +- [Create](#afdorigins_create) +- [Delete](#afdorigins_delete) +- [Get](#afdorigins_get) +- [ListByOriginGroup](#afdorigins_listbyorigingroup) +- [Update](#afdorigins_update) + +## AfdProfiles + +- [CheckHostnameAvailability](#afdprofiles_checkhostnameavailability) +- [ListResourceUsage](#afdprofiles_listresourceusage) +- [Upgrade](#afdprofiles_upgrade) +- [ValidateSecret](#afdprofiles_validatesecret) + +## CustomDomains + +- [Create](#customdomains_create) +- [Delete](#customdomains_delete) +- [DisableCustomHttps](#customdomains_disablecustomhttps) +- [EnableCustomHttps](#customdomains_enablecustomhttps) +- [Get](#customdomains_get) +- [ListByEndpoint](#customdomains_listbyendpoint) + +## EdgeNodes + +- [List](#edgenodes_list) + +## Endpoints + +- [Create](#endpoints_create) +- [Delete](#endpoints_delete) +- [Get](#endpoints_get) +- [ListByProfile](#endpoints_listbyprofile) +- [ListResourceUsage](#endpoints_listresourceusage) +- [LoadContent](#endpoints_loadcontent) +- [PurgeContent](#endpoints_purgecontent) +- [Start](#endpoints_start) +- [Stop](#endpoints_stop) +- [Update](#endpoints_update) +- [ValidateCustomDomain](#endpoints_validatecustomdomain) + +## LogAnalytics + +- [GetLogAnalyticsLocations](#loganalytics_getloganalyticslocations) +- [GetLogAnalyticsMetrics](#loganalytics_getloganalyticsmetrics) +- [GetLogAnalyticsRankings](#loganalytics_getloganalyticsrankings) +- [GetLogAnalyticsResources](#loganalytics_getloganalyticsresources) +- [GetWafLogAnalyticsMetrics](#loganalytics_getwafloganalyticsmetrics) +- [GetWafLogAnalyticsRankings](#loganalytics_getwafloganalyticsrankings) + +## ManagedRuleSets + +- [List](#managedrulesets_list) + +## Operations + +- [List](#operations_list) + +## OriginGroups + +- [Create](#origingroups_create) +- [Delete](#origingroups_delete) +- [Get](#origingroups_get) +- [ListByEndpoint](#origingroups_listbyendpoint) +- [Update](#origingroups_update) + +## Origins + +- [Create](#origins_create) +- [Delete](#origins_delete) +- [Get](#origins_get) +- [ListByEndpoint](#origins_listbyendpoint) +- [Update](#origins_update) + +## Policies + +- [CreateOrUpdate](#policies_createorupdate) +- [Delete](#policies_delete) +- [GetByResourceGroup](#policies_getbyresourcegroup) +- [ListByResourceGroup](#policies_listbyresourcegroup) +- [Update](#policies_update) + +## Profiles + +- [CanMigrate](#profiles_canmigrate) +- [Create](#profiles_create) +- [Delete](#profiles_delete) +- [GenerateSsoUri](#profiles_generatessouri) +- [GetByResourceGroup](#profiles_getbyresourcegroup) +- [List](#profiles_list) +- [ListByResourceGroup](#profiles_listbyresourcegroup) +- [ListResourceUsage](#profiles_listresourceusage) +- [ListSupportedOptimizationTypes](#profiles_listsupportedoptimizationtypes) +- [Migrate](#profiles_migrate) +- [MigrationCommit](#profiles_migrationcommit) +- [Update](#profiles_update) + +## ResourceProvider + +- [CheckEndpointNameAvailability](#resourceprovider_checkendpointnameavailability) +- [CheckNameAvailability](#resourceprovider_checknameavailability) +- [CheckNameAvailabilityWithSubscription](#resourceprovider_checknameavailabilitywithsubscription) +- [ValidateProbe](#resourceprovider_validateprobe) + +## ResourceUsage + +- [List](#resourceusage_list) + +## Routes + +- [Create](#routes_create) +- [Delete](#routes_delete) +- [Get](#routes_get) +- [ListByEndpoint](#routes_listbyendpoint) +- [Update](#routes_update) + +## RuleSets + +- [Create](#rulesets_create) +- [Delete](#rulesets_delete) +- [Get](#rulesets_get) +- [ListByProfile](#rulesets_listbyprofile) +- [ListResourceUsage](#rulesets_listresourceusage) + +## Rules + +- [Create](#rules_create) +- [Delete](#rules_delete) +- [Get](#rules_get) +- [ListByRuleSet](#rules_listbyruleset) +- [Update](#rules_update) + +## Secrets + +- [Create](#secrets_create) +- [Delete](#secrets_delete) +- [Get](#secrets_get) +- [ListByProfile](#secrets_listbyprofile) + +## SecurityPolicies + +- [Create](#securitypolicies_create) +- [Delete](#securitypolicies_delete) +- [Get](#securitypolicies_get) +- [ListByProfile](#securitypolicies_listbyprofile) +- [Patch](#securitypolicies_patch) +### AfdCustomDomains_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for AfdCustomDomains Create. */ +public final class AfdCustomDomainsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Create.json + */ + /** + * Sample code: AFDCustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdCustomDomains() + .define("domain1") + .withExistingProfile("RG", "profile1") + .withHostname("www.someDomain.net") + .withTlsSettings( + new AfdDomainHttpsParameters() + .withCertificateType(AfdCertificateType.MANAGED_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .create(); + } +} +``` + +### AfdCustomDomains_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains Delete. */ +public final class AfdCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Delete.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().delete("RG", "profile1", "domain1", Context.NONE); + } +} +``` + +### AfdCustomDomains_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains Get. */ +public final class AfdCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Get.json + */ + /** + * Sample code: AFDCustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", Context.NONE); + } +} +``` + +### AfdCustomDomains_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains ListByProfile. */ +public final class AfdCustomDomainsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_ListByProfile.json + */ + /** + * Sample code: AFDCustomDomains_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### AfdCustomDomains_RefreshValidationToken + +```java +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains RefreshValidationToken. */ +public final class AfdCustomDomainsRefreshValidationTokenSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_RefreshValidationToken.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().refreshValidationToken("RG", "profile1", "domain1", Context.NONE); + } +} +``` + +### AfdCustomDomains_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for AfdCustomDomains Update. */ +public final class AfdCustomDomainsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Update.json + */ + /** + * Sample code: AFDCustomDomains_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdDomain resource = + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", Context.NONE).getValue(); + resource + .update() + .withTlsSettings( + new AfdDomainHttpsParameters() + .withCertificateType(AfdCertificateType.CUSTOMER_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .apply(); + } +} +``` + +### AfdEndpoints_Create + +```java +/** Samples for AfdEndpoints Create. */ +public final class AfdEndpointsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Create.json + */ + /** + * Sample code: AFDEndpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} +``` + +### AfdEndpoints_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints Delete. */ +public final class AfdEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Delete.json + */ + /** + * Sample code: AFDEndpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().delete("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### AfdEndpoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints Get. */ +public final class AfdEndpointsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Get.json + */ + /** + * Sample code: AFDEndpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### AfdEndpoints_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints ListByProfile. */ +public final class AfdEndpointsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ListByProfile.json + */ + /** + * Sample code: AFDEndpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### AfdEndpoints_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints ListResourceUsage. */ +public final class AfdEndpointsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ListResourceUsage.json + */ + /** + * Sample code: AFDEndpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listResourceUsage("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### AfdEndpoints_PurgeContent + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import java.util.Arrays; + +/** Samples for AfdEndpoints PurgeContent. */ +public final class AfdEndpointsPurgeContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_PurgeContent.json + */ + /** + * Sample code: AFDEndpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .purgeContent( + "RG", + "profile1", + "endpoint1", + new AfdPurgeParameters() + .withContentPaths(Arrays.asList("/folder1")) + .withDomains(Arrays.asList("endpoint1-abcdefghijklmnop.z01.azurefd.net")), + Context.NONE); + } +} +``` + +### AfdEndpoints_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AfdEndpoints Update. */ +public final class AfdEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Update.json + */ + /** + * Sample code: AFDEndpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdEndpoint resource = + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE).getValue(); + resource.update().withTags(mapOf()).withEnabledState(EnabledState.ENABLED).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; + } +} +``` + +### AfdEndpoints_ValidateCustomDomain + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** Samples for AfdEndpoints ValidateCustomDomain. */ +public final class AfdEndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .validateCustomDomainWithResponse( + "RG", + "profile1", + "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), + Context.NONE); + } +} +``` + +### AfdOriginGroups_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** Samples for AfdOriginGroups Create. */ +public final class AfdOriginGroupsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Create.json + */ + /** + * Sample code: AFDOriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdOriginGroups() + .define("origingroup1") + .withExistingProfile("RG", "profile1") + .withLoadBalancingSettings( + new LoadBalancingSettingsParameters() + .withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .create(); + } +} +``` + +### AfdOriginGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups Delete. */ +public final class AfdOriginGroupsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Delete.json + */ + /** + * Sample code: AFDOriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().delete("RG", "profile1", "origingroup1", Context.NONE); + } +} +``` + +### AfdOriginGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups Get. */ +public final class AfdOriginGroupsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Get.json + */ + /** + * Sample code: AFDOriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", Context.NONE); + } +} +``` + +### AfdOriginGroups_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups ListByProfile. */ +public final class AfdOriginGroupsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_ListByProfile.json + */ + /** + * Sample code: AFDOriginGroups_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### AfdOriginGroups_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups ListResourceUsage. */ +public final class AfdOriginGroupsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_ListResourceUsage.json + */ + /** + * Sample code: AFDOriginGroups_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listResourceUsage("RG", "profile1", "origingroup1", Context.NONE); + } +} +``` + +### AfdOriginGroups_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** Samples for AfdOriginGroups Update. */ +public final class AfdOriginGroupsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Update.json + */ + /** + * Sample code: AFDOriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOriginGroup resource = + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", Context.NONE).getValue(); + resource + .update() + .withLoadBalancingSettings( + new LoadBalancingSettingsParameters() + .withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .apply(); + } +} +``` + +### AfdOrigins_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** Samples for AfdOrigins Create. */ +public final class AfdOriginsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Create.json + */ + /** + * Sample code: AFDOrigins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdOrigins() + .define("origin1") + .withExistingOriginGroup("RG", "profile1", "origingroup1") + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("host1.foo.com") + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} +``` + +### AfdOrigins_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOrigins Delete. */ +public final class AfdOriginsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Delete.json + */ + /** + * Sample code: AFDOrigins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().delete("RG", "profile1", "origingroup1", "origin1", Context.NONE); + } +} +``` + +### AfdOrigins_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOrigins Get. */ +public final class AfdOriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Get.json + */ + /** + * Sample code: AFDOrigins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().getWithResponse("RG", "profile1", "origingroup1", "origin1", Context.NONE); + } +} +``` + +### AfdOrigins_ListByOriginGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AfdOrigins ListByOriginGroup. */ +public final class AfdOriginsListByOriginGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_ListByOriginGroup.json + */ + /** + * Sample code: AFDOrigins_ListByOriginGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsListByOriginGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().listByOriginGroup("RG", "profile1", "origingroup1", Context.NONE); + } +} +``` + +### AfdOrigins_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** Samples for AfdOrigins Update. */ +public final class AfdOriginsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Update.json + */ + /** + * Sample code: AFDOrigins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOrigin resource = + manager.afdOrigins().getWithResponse("RG", "profile1", "origingroup1", "origin1", Context.NONE).getValue(); + resource + .update() + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} +``` + +### AfdProfiles_CheckHostnameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; + +/** Samples for AfdProfiles CheckHostnameAvailability. */ +public final class AfdProfilesCheckHostnameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_CheckHostNameAvailability.json + */ + /** + * Sample code: AFDProfiles_CheckHostNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesCheckHostNameAvailability( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .checkHostnameAvailabilityWithResponse( + "RG", + "profile1", + new CheckHostnameAvailabilityInput().withHostname("www.someDomain.net"), + Context.NONE); + } +} +``` + +### AfdProfiles_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for AfdProfiles ListResourceUsage. */ +public final class AfdProfilesListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_ListResourceUsage.json + */ + /** + * Sample code: AFDProfiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles().listResourceUsage("RG", "profile1", Context.NONE); + } +} +``` + +### AfdProfiles_Upgrade + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ProfileChangeSkuWafMapping; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for AfdProfiles Upgrade. */ +public final class AfdProfilesUpgradeSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_Upgrade.json + */ + /** + * Sample code: AFDProfiles_Upgrade. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesUpgrade(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .upgrade( + "RG", + "profile1", + new ProfileUpgradeParameters() + .withWafMappingList( + Arrays + .asList( + new ProfileChangeSkuWafMapping() + .withSecurityPolicyName("securityPolicy1") + .withChangeToWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2")))), + Context.NONE); + } +} +``` + +### AfdProfiles_ValidateSecret + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecretType; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** Samples for AfdProfiles ValidateSecret. */ +public final class AfdProfilesValidateSecretSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_ValidateSecret.json + */ + /** + * Sample code: Validate_Secret. + * + * @param manager Entry point to CdnManager. + */ + public static void validateSecret(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .validateSecretWithResponse( + "RG", + "profile1", + new ValidateSecretInput() + .withSecretType(SecretType.CUSTOMER_CERTIFICATE) + .withSecretSource( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName")), + Context.NONE); + } +} +``` + +### CustomDomains_Create + +```java +/** Samples for CustomDomains Create. */ +public final class CustomDomainsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Create.json + */ + /** + * Sample code: CustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .create(); + } +} +``` + +### CustomDomains_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().delete("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} +``` + +### CustomDomains_DisableCustomHttps + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains DisableCustomHttps. */ +public final class CustomDomainsDisableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_DisableCustomHttps.json + */ + /** + * Sample code: CustomDomains_DisableCustomHttps. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDisableCustomHttps(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().disableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} +``` + +### CustomDomains_EnableCustomHttps + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains EnableCustomHttps. */ +public final class CustomDomainsEnableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingCDNManagedCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingYourOwnCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingYourOwnCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, Context.NONE); + } +} +``` + +### CustomDomains_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} +``` + +### CustomDomains_ListByEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains ListByEndpoint. */ +public final class CustomDomainsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_ListByEndpoint.json + */ + /** + * Sample code: CustomDomains_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### EdgeNodes_List + +```java +import com.azure.core.util.Context; + +/** Samples for EdgeNodes List. */ +public final class EdgeNodesListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/EdgeNodes_List.json + */ + /** + * Sample code: EdgeNodes_List. + * + * @param manager Entry point to CdnManager. + */ + public static void edgeNodesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.edgeNodes().list(Context.NONE); + } +} +``` + +### Endpoints_Create + +```java +/** Samples for Endpoints Create. */ +public final class EndpointsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Create.json + */ + /** + * Sample code: Endpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} +``` + +### Endpoints_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints Delete. */ +public final class EndpointsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Delete.json + */ + /** + * Sample code: Endpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().delete("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Endpoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints Get. */ +public final class EndpointsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Get.json + */ + /** + * Sample code: Endpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Endpoints_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints ListByProfile. */ +public final class EndpointsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ListByProfile.json + */ + /** + * Sample code: Endpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### Endpoints_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints ListResourceUsage. */ +public final class EndpointsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ListResourceUsage.json + */ + /** + * Sample code: Endpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listResourceUsage("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Endpoints_LoadContent + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import java.util.Arrays; + +/** Samples for Endpoints LoadContent. */ +public final class EndpointsLoadContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_LoadContent.json + */ + /** + * Sample code: Endpoints_LoadContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsLoadContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .loadContent( + "RG", + "profile1", + "endpoint1", + new LoadParameters().withContentPaths(Arrays.asList("/folder1")), + Context.NONE); + } +} +``` + +### Endpoints_PurgeContent + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import java.util.Arrays; + +/** Samples for Endpoints PurgeContent. */ +public final class EndpointsPurgeContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_PurgeContent.json + */ + /** + * Sample code: Endpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .purgeContent( + "RG", + "profile1", + "endpoint1", + new PurgeParameters().withContentPaths(Arrays.asList("/folder1")), + Context.NONE); + } +} +``` + +### Endpoints_Start + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints Start. */ +public final class EndpointsStartSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Start.json + */ + /** + * Sample code: Endpoints_Start. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStart(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().start("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Endpoints_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for Endpoints Stop. */ +public final class EndpointsStopSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Stop.json + */ + /** + * Sample code: Endpoints_Stop. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStop(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().stop("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Endpoints_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Endpoints Update. */ +public final class EndpointsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Update.json + */ + /** + * Sample code: Endpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Endpoint resource = manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE).getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).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; + } +} +``` + +### Endpoints_ValidateCustomDomain + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** Samples for Endpoints ValidateCustomDomain. */ +public final class EndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .validateCustomDomainWithResponse( + "RG", + "profile1", + "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), + Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsLocations + +```java +import com.azure.core.util.Context; + +/** Samples for LogAnalytics GetLogAnalyticsLocations. */ +public final class LogAnalyticsGetLogAnalyticsLocationsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsLocations.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsLocations. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsLocations( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsLocationsWithResponse("RG", "profile1", Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsMetrics + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetLogAnalyticsMetrics. */ +public final class LogAnalyticsGetLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getLogAnalyticsMetricsWithResponse( + "RG", + "profile1", + Arrays.asList(LogMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T04:30:00.000Z"), + OffsetDateTime.parse("2020-11-04T05:00:00.000Z"), + LogMetricsGranularity.PT5M, + Arrays.asList("customdomain1.azurecdn.net", "customdomain2.azurecdn.net"), + Arrays.asList("https"), + Arrays.asList(LogMetricsGroupBy.PROTOCOL), + null, + null, + Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsRankings + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetLogAnalyticsRankings. */ +public final class LogAnalyticsGetLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getLogAnalyticsRankingsWithResponse( + "RG", + "profile1", + Arrays.asList(LogRanking.URL), + Arrays.asList(LogRankingMetric.CLIENT_REQUEST_COUNT), + 5, + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + null, + Context.NONE); + } +} +``` + +### LogAnalytics_GetLogAnalyticsResources + +```java +import com.azure.core.util.Context; + +/** Samples for LogAnalytics GetLogAnalyticsResources. */ +public final class LogAnalyticsGetLogAnalyticsResourcesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsResources.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsResources. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsResources( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsResourcesWithResponse("RG", "profile1", Context.NONE); + } +} +``` + +### LogAnalytics_GetWafLogAnalyticsMetrics + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetWafLogAnalyticsMetrics. */ +public final class LogAnalyticsGetWafLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetWafLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetWafLogAnalyticsMetrics( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getWafLogAnalyticsMetricsWithResponse( + "RG", + "profile1", + Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + WafGranularity.PT5M, + Arrays.asList(WafAction.BLOCK, WafAction.LOG), + null, + null, + Context.NONE); + } +} +``` + +### LogAnalytics_GetWafLogAnalyticsRankings + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetWafLogAnalyticsRankings. */ +public final class LogAnalyticsGetWafLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetWafLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetWafLogAnalyticsRankings( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getWafLogAnalyticsRankingsWithResponse( + "RG", + "profile1", + Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + 5, + Arrays.asList(WafRankingType.RULE_ID), + null, + null, + Context.NONE); + } +} +``` + +### ManagedRuleSets_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedRuleSets List. */ +public final class ManagedRuleSetsListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafListManagedRuleSets.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.managedRuleSets().list(Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to CdnManager. + */ + public static void operationsList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### OriginGroups_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedDetectedErrorTypes; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Arrays; + +/** Samples for OriginGroups Create. */ +public final class OriginGroupsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Create.json + */ + /** + * Sample code: OriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .originGroups() + .define("origingroup1") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"))) + .withResponseBasedOriginErrorDetectionSettings( + new ResponseBasedOriginErrorDetectionParameters() + .withResponseBasedDetectedErrorTypes(ResponseBasedDetectedErrorTypes.TCP_ERRORS_ONLY) + .withResponseBasedFailoverThresholdPercentage(10)) + .create(); + } +} +``` + +### OriginGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for OriginGroups Delete. */ +public final class OriginGroupsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Delete.json + */ + /** + * Sample code: OriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().delete("RG", "profile1", "endpoint1", "originGroup1", Context.NONE); + } +} +``` + +### OriginGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OriginGroups Get. */ +public final class OriginGroupsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Get.json + */ + /** + * Sample code: OriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().getWithResponse("RG", "profile1", "endpoint1", "originGroup1", Context.NONE); + } +} +``` + +### OriginGroups_ListByEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for OriginGroups ListByEndpoint. */ +public final class OriginGroupsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_ListByEndpoint.json + */ + /** + * Sample code: OriginsGroups_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGroupsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### OriginGroups_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for OriginGroups Update. */ +public final class OriginGroupsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Update.json + */ + /** + * Sample code: OriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + OriginGroup resource = + manager + .originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", Context.NONE) + .getValue(); + resource + .update() + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"))) + .apply(); + } +} +``` + +### Origins_Create + +```java +/** Samples for Origins Create. */ +public final class OriginsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Create.json + */ + /** + * Sample code: Origins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .origins() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("www.someDomain.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkResourceId( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1") + .withPrivateLinkLocation("eastus") + .withPrivateLinkApprovalMessage("Please approve the connection request for this Private Link") + .create(); + } +} +``` + +### Origins_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Origins Delete. */ +public final class OriginsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Delete.json + */ + /** + * Sample code: Origins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().delete("RG", "profile1", "endpoint1", "origin1", Context.NONE); + } +} +``` + +### Origins_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Origins Get. */ +public final class OriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Get.json + */ + /** + * Sample code: Origins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} +``` + +### Origins_ListByEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for Origins ListByEndpoint. */ +public final class OriginsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_ListByEndpoint.json + */ + /** + * Sample code: Origins_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Origins_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Origin; + +/** Samples for Origins Update. */ +public final class OriginsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Update.json + */ + /** + * Sample code: Origins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Origin resource = + manager + .origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE) + .getValue(); + resource + .update() + .withHttpPort(42) + .withHttpsPort(43) + .withOriginHostHeader("www.someDomain2.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkAlias("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice") + .apply(); + } +} +``` + +### Policies_CreateOrUpdate + +```java +import com.azure.resourcemanager.cdn.generated.models.ActionType; +import com.azure.resourcemanager.cdn.generated.models.CustomRule; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.MatchCondition; +import com.azure.resourcemanager.cdn.generated.models.Operator; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.PolicySettingsDefaultCustomBlockResponseStatusCode; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRule; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; +import com.azure.resourcemanager.cdn.generated.models.TransformType; +import com.azure.resourcemanager.cdn.generated.models.WafMatchVariable; +import java.util.Arrays; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .policies() + .define("MicrosoftCdnWafPolicy") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.STANDARD_MICROSOFT)) + .withPolicySettings( + new PolicySettings() + .withDefaultRedirectUrl("http://www.bing.com") + .withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode.TWO_ZERO_ZERO) + .withDefaultCustomBlockResponseBody( + "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==")) + .withRateLimitRules( + new RateLimitRuleList() + .withRules( + Arrays + .asList( + new RateLimitRule() + .withName("RateLimitRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(1) + .withMatchConditions( + Arrays + .asList( + new MatchCondition() + .withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.IPMATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")) + .withTransforms(Arrays.asList()))) + .withAction(ActionType.BLOCK) + .withRateLimitThreshold(1000) + .withRateLimitDurationInMinutes(0)))) + .withCustomRules( + new CustomRuleList() + .withRules( + Arrays + .asList( + new CustomRule() + .withName("CustomRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(2) + .withMatchConditions( + Arrays + .asList( + new MatchCondition() + .withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.GEO_MATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("CH")) + .withTransforms(Arrays.asList()), + new MatchCondition() + .withMatchVariable(WafMatchVariable.REQUEST_HEADER) + .withSelector("UserAgent") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("windows")) + .withTransforms(Arrays.asList()), + new MatchCondition() + .withMatchVariable(WafMatchVariable.QUERY_STRING) + .withSelector("search") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("")) + .withTransforms( + Arrays + .asList( + TransformType.URL_DECODE, TransformType.LOWERCASE)))) + .withAction(ActionType.BLOCK)))) + .withManagedRules( + new ManagedRuleSetList() + .withManagedRuleSets( + Arrays + .asList( + new ManagedRuleSet() + .withRuleSetType("DefaultRuleSet") + .withRuleSetVersion("preview-1.0") + .withRuleGroupOverrides( + Arrays + .asList( + new ManagedRuleGroupOverride() + .withRuleGroupName("Group1") + .withRules( + Arrays + .asList( + new ManagedRuleOverride() + .withRuleId("GROUP1-0001") + .withEnabledState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.REDIRECT), + new ManagedRuleOverride() + .withRuleId("GROUP1-0002") + .withEnabledState( + ManagedRuleEnabledState.DISABLED)))))))) + .create(); + } +} +``` + +### Policies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyDelete.json + */ + /** + * Sample code: Delete protection policy. + * + * @param manager Entry point to CdnManager. + */ + public static void deleteProtectionPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().deleteByResourceGroupWithResponse("rg1", "Policy1", Context.NONE); + } +} +``` + +### Policies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Policies GetByResourceGroup. */ +public final class PoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyGet.json + */ + /** + * Sample code: Get Policy. + * + * @param manager Entry point to CdnManager. + */ + public static void getPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", Context.NONE); + } +} +``` + +### Policies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Policies ListByResourceGroup. */ +public final class PoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafListPolicies.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### Policies_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPatchPolicy.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + CdnWebApplicationFirewallPolicy resource = + manager.policies().getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", Context.NONE).getValue(); + resource.update().withTags(mapOf("foo", "bar")).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; + } +} +``` + +### Profiles_CanMigrate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for Profiles CanMigrate. */ +public final class ProfilesCanMigrateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .canMigrateWithResponse( + "RG", + new CanMigrateParameters() + .withClassicResourceReference( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")), + Context.NONE); + } +} +``` + +### Profiles_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** Samples for Profiles Create. */ +public final class ProfilesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Create.json + */ + /** + * Sample code: Profiles_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .define("profile1") + .withRegion("global") + .withExistingResourceGroup("RG") + .withSku(new Sku().withName(SkuName.PREMIUM_AZURE_FRONT_DOOR)) + .create(); + } +} +``` + +### Profiles_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles Delete. */ +public final class ProfilesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Delete.json + */ + /** + * Sample code: Profiles_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().delete("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_GenerateSsoUri + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles GenerateSsoUri. */ +public final class ProfilesGenerateSsoUriSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_GenerateSsoUri.json + */ + /** + * Sample code: Profiles_GenerateSsoUri. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGenerateSsoUri(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().generateSsoUriWithResponse("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles GetByResourceGroup. */ +public final class ProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Get.json + */ + /** + * Sample code: Profiles_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().getByResourceGroupWithResponse("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_List + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles List. */ +public final class ProfilesListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_List.json + */ + /** + * Sample code: Profiles_List. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().list(Context.NONE); + } +} +``` + +### Profiles_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles ListByResourceGroup. */ +public final class ProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListByResourceGroup.json + */ + /** + * Sample code: Profiles_ListByResourceGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListByResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listByResourceGroup("RG", Context.NONE); + } +} +``` + +### Profiles_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles ListResourceUsage. */ +public final class ProfilesListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListResourceUsage.json + */ + /** + * Sample code: Profiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listResourceUsage("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_ListSupportedOptimizationTypes + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles ListSupportedOptimizationTypes. */ +public final class ProfilesListSupportedOptimizationTypesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListSupportedOptimizationTypes.json + */ + /** + * Sample code: Profiles_ListSupportedOptimizationTypes. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListSupportedOptimizationTypes( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listSupportedOptimizationTypesWithResponse("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_Migrate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** Samples for Profiles Migrate. */ +public final class ProfilesMigrateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Migrate.json + */ + /** + * Sample code: Profiles_Migrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .migrate( + "RG", + new MigrationParameters() + .withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)) + .withClassicResourceReference( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")) + .withProfileName("profile1"), + Context.NONE); + } +} +``` + +### Profiles_MigrationCommit + +```java +import com.azure.core.util.Context; + +/** Samples for Profiles MigrationCommit. */ +public final class ProfilesMigrationCommitSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_MigrationCommit.json + */ + /** + * Sample code: Profiles_MigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationCommit("RG", "profile1", Context.NONE); + } +} +``` + +### Profiles_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Profiles Update. */ +public final class ProfilesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Update.json + */ + /** + * Sample code: Profiles_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Profile resource = manager.profiles().getByResourceGroupWithResponse("RG", "profile1", Context.NONE).getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).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; + } +} +``` + +### ResourceProvider_CheckEndpointNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckEndpointNameAvailability. */ +public final class ResourceProviderCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkEndpointNameAvailabilityWithResponse( + "myResourceGroup", + new CheckEndpointNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), + Context.NONE); + } +} +``` + +### ResourceProvider_CheckNameAvailabilityWithSubscription + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckNameAvailabilityWithSubscription. */ +public final class ResourceProviderCheckNameAvailabilityWithSubscriptionSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckNameAvailabilityWithSubscription.json + */ + /** + * Sample code: CheckNameAvailabilityWithSubscription. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailabilityWithSubscription( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithSubscriptionWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), + Context.NONE); + } +} +``` + +### ResourceProvider_ValidateProbe + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** Samples for ResourceProvider ValidateProbe. */ +public final class ResourceProviderValidateProbeSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/ValidateProbe.json + */ + /** + * Sample code: ValidateProbe. + * + * @param manager Entry point to CdnManager. + */ + public static void validateProbe(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .validateProbeWithResponse( + new ValidateProbeInput().withProbeUrl("https://www.bing.com/image"), Context.NONE); + } +} +``` + +### ResourceUsage_List + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceUsage List. */ +public final class ResourceUsageListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/ResourceUsage_List.json + */ + /** + * Sample code: ResourceUsage_List. + * + * @param manager Entry point to CdnManager. + */ + public static void resourceUsageList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceUsages().list(Context.NONE); + } +} +``` + +### Routes_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for Routes Create. */ +public final class RoutesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Create.json + */ + /** + * Sample code: Routes_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void routesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .routes() + .define("route1") + .withExistingAfdEndpoint("RG", "profile1", "endpoint1") + .withCustomDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration( + new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_SPECIFIED_QUERY_STRINGS) + .withQueryParameters("querystring=test") + .withCompressionSettings( + new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} +``` + +### Routes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Routes Delete. */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Delete.json + */ + /** + * Sample code: Routes_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void routesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().delete("RG", "profile1", "endpoint1", "route1", Context.NONE); + } +} +``` + +### Routes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Routes Get. */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Get.json + */ + /** + * Sample code: Routes_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void routesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", Context.NONE); + } +} +``` + +### Routes_ListByEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for Routes ListByEndpoint. */ +public final class RoutesListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_ListByEndpoint.json + */ + /** + * Sample code: Routes_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void routesListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} +``` + +### Routes_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import java.util.Arrays; + +/** Samples for Routes Update. */ +public final class RoutesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Update.json + */ + /** + * Sample code: Routes_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void routesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Route resource = + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", Context.NONE).getValue(); + resource + .update() + .withCustomDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration( + new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_QUERY_STRING) + .withCompressionSettings( + new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} +``` + +### RuleSets_Create + +```java +import com.azure.core.util.Context; + +/** Samples for RuleSets Create. */ +public final class RuleSetsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Create.json + */ + /** + * Sample code: RuleSets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().createWithResponse("RG", "profile1", "ruleSet1", Context.NONE); + } +} +``` + +### RuleSets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RuleSets Delete. */ +public final class RuleSetsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Delete.json + */ + /** + * Sample code: RuleSets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().delete("RG", "profile1", "ruleSet1", Context.NONE); + } +} +``` + +### RuleSets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RuleSets Get. */ +public final class RuleSetsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Get.json + */ + /** + * Sample code: RuleSets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().getWithResponse("RG", "profile1", "ruleSet1", Context.NONE); + } +} +``` + +### RuleSets_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for RuleSets ListByProfile. */ +public final class RuleSetsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_ListByProfile.json + */ + /** + * Sample code: RuleSets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### RuleSets_ListResourceUsage + +```java +import com.azure.core.util.Context; + +/** Samples for RuleSets ListResourceUsage. */ +public final class RuleSetsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_ListResourceUsage.json + */ + /** + * Sample code: RuleSets_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listResourceUsage("RG", "profile1", "ruleSet1", Context.NONE); + } +} +``` + +### Rules_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleRequestMethodCondition; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParametersMatchValuesItem; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodOperator; +import java.util.Arrays; + +/** Samples for Rules Create. */ +public final class RulesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Create.json + */ + /** + * Sample code: Rules_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .rules() + .define("rule1") + .withExistingRuleSet("RG", "profile1", "ruleSet1") + .withOrder(1) + .withConditions( + Arrays + .asList( + new DeliveryRuleRequestMethodCondition() + .withParameters( + new RequestMethodMatchConditionParameters() + .withOperator(RequestMethodOperator.EQUAL) + .withNegateCondition(false) + .withMatchValues( + Arrays.asList(RequestMethodMatchConditionParametersMatchValuesItem.GET))))) + .withActions( + Arrays + .asList( + new DeliveryRuleResponseHeaderAction() + .withParameters( + new HeaderActionParameters() + .withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .create(); + } +} +``` + +### Rules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Rules Delete. */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Delete.json + */ + /** + * Sample code: Rules_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().delete("RG", "profile1", "ruleSet1", "rule1", Context.NONE); + } +} +``` + +### Rules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Rules Get. */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Get.json + */ + /** + * Sample code: Rules_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", Context.NONE); + } +} +``` + +### Rules_ListByRuleSet + +```java +import com.azure.core.util.Context; + +/** Samples for Rules ListByRuleSet. */ +public final class RulesListByRuleSetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_ListByRuleSet.json + */ + /** + * Sample code: Rules_ListByRuleSet. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesListByRuleSet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().listByRuleSet("RG", "profile1", "ruleSet1", Context.NONE); + } +} +``` + +### Rules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import java.util.Arrays; + +/** Samples for Rules Update. */ +public final class RulesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Update.json + */ + /** + * Sample code: Rules_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Rule resource = manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", Context.NONE).getValue(); + resource + .update() + .withOrder(1) + .withActions( + Arrays + .asList( + new DeliveryRuleResponseHeaderAction() + .withParameters( + new HeaderActionParameters() + .withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .apply(); + } +} +``` + +### Secrets_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.CustomerCertificateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for Secrets Create. */ +public final class SecretsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Create.json + */ + /** + * Sample code: Secrets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .secrets() + .define("secret1") + .withExistingProfile("RG", "profile1") + .withParameters( + new CustomerCertificateParameters() + .withSecretSource( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/secrets/certificatename")) + .withSecretVersion("abcdef1234578900abcdef1234567890") + .withUseLatestVersion(false)) + .create(); + } +} +``` + +### Secrets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().delete("RG", "profile1", "secret1", Context.NONE); + } +} +``` + +### Secrets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().getWithResponse("RG", "profile1", "secret1", Context.NONE); + } +} +``` + +### Secrets_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets ListByProfile. */ +public final class SecretsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_ListByProfile.json + */ + /** + * Sample code: Secrets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### SecurityPolicies_Create + +```java +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** Samples for SecurityPolicies Create. */ +public final class SecurityPoliciesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Create.json + */ + /** + * Sample code: SecurityPolicies_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .securityPolicies() + .define("securityPolicy1") + .withExistingProfile("RG", "profile1") + .withParameters( + new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations( + Arrays + .asList( + new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .create(); + } +} +``` + +### SecurityPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies Delete. */ +public final class SecurityPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Delete.json + */ + /** + * Sample code: SecurityPolicies_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().delete("RG", "profile1", "securityPolicy1", Context.NONE); + } +} +``` + +### SecurityPolicies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies Get. */ +public final class SecurityPoliciesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Get.json + */ + /** + * Sample code: SecurityPolicies_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().getWithResponse("RG", "profile1", "securityPolicy1", Context.NONE); + } +} +``` + +### SecurityPolicies_ListByProfile + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies ListByProfile. */ +public final class SecurityPoliciesListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_ListByProfile.json + */ + /** + * Sample code: SecurityPolicies_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().listByProfile("RG", "profile1", Context.NONE); + } +} +``` + +### SecurityPolicies_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** Samples for SecurityPolicies Patch. */ +public final class SecurityPoliciesPatchSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Patch.json + */ + /** + * Sample code: SecurityPolicies_Patch. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesPatch(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + SecurityPolicy resource = + manager.securityPolicies().getWithResponse("RG", "profile1", "securityPolicy1", Context.NONE).getValue(); + resource + .update() + .withParameters( + new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations( + Arrays + .asList( + new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .apply(); + } +} +``` + diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml b/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml new file mode 100644 index 0000000000000..93142d9e43bb9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-cdn-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Cdn Management + This package contains Microsoft Azure SDK for Cdn Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cdn Management Client. Package tag package-preview-2022-11. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.33.0 + + + com.azure + azure-core-management + 1.8.1 + + + diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java new file mode 100644 index 0000000000000..422aa7e7e2c5c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java @@ -0,0 +1,618 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.CdnManagementClient; +import com.azure.resourcemanager.cdn.generated.implementation.AfdCustomDomainsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdEndpointsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdOriginGroupsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdOriginsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.AfdProfilesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.CdnManagementClientBuilder; +import com.azure.resourcemanager.cdn.generated.implementation.CustomDomainsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.EdgeNodesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.EndpointsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.LogAnalyticsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ManagedRuleSetsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OriginGroupsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.OriginsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.PoliciesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ProfilesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.cdn.generated.implementation.ResourceUsagesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RoutesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RuleSetsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.RulesImpl; +import com.azure.resourcemanager.cdn.generated.implementation.SecretsImpl; +import com.azure.resourcemanager.cdn.generated.implementation.SecurityPoliciesImpl; +import com.azure.resourcemanager.cdn.generated.models.AfdCustomDomains; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoints; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroups; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigins; +import com.azure.resourcemanager.cdn.generated.models.AfdProfiles; +import com.azure.resourcemanager.cdn.generated.models.CustomDomains; +import com.azure.resourcemanager.cdn.generated.models.EdgeNodes; +import com.azure.resourcemanager.cdn.generated.models.Endpoints; +import com.azure.resourcemanager.cdn.generated.models.LogAnalytics; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSets; +import com.azure.resourcemanager.cdn.generated.models.Operations; +import com.azure.resourcemanager.cdn.generated.models.OriginGroups; +import com.azure.resourcemanager.cdn.generated.models.Origins; +import com.azure.resourcemanager.cdn.generated.models.Policies; +import com.azure.resourcemanager.cdn.generated.models.Profiles; +import com.azure.resourcemanager.cdn.generated.models.ResourceProviders; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsages; +import com.azure.resourcemanager.cdn.generated.models.Routes; +import com.azure.resourcemanager.cdn.generated.models.RuleSets; +import com.azure.resourcemanager.cdn.generated.models.Rules; +import com.azure.resourcemanager.cdn.generated.models.Secrets; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicies; +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 CdnManager. Cdn Management Client. */ +public final class CdnManager { + private ResourceProviders resourceProviders; + + private AfdProfiles afdProfiles; + + private AfdCustomDomains afdCustomDomains; + + private AfdEndpoints afdEndpoints; + + private AfdOriginGroups afdOriginGroups; + + private AfdOrigins afdOrigins; + + private Routes routes; + + private RuleSets ruleSets; + + private Rules rules; + + private SecurityPolicies securityPolicies; + + private Secrets secrets; + + private LogAnalytics logAnalytics; + + private Profiles profiles; + + private Endpoints endpoints; + + private Origins origins; + + private OriginGroups originGroups; + + private CustomDomains customDomains; + + private ResourceUsages resourceUsages; + + private Operations operations; + + private EdgeNodes edgeNodes; + + private Policies policies; + + private ManagedRuleSets managedRuleSets; + + private final CdnManagementClient clientObject; + + private CdnManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new CdnManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Cdn service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public static CdnManager 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 Cdn service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public static CdnManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new CdnManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create CdnManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new CdnManager.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 Cdn service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Cdn service API instance. + */ + public CdnManager 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.cdn.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 CdnManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of AfdProfiles. + * + * @return Resource collection API of AfdProfiles. + */ + public AfdProfiles afdProfiles() { + if (this.afdProfiles == null) { + this.afdProfiles = new AfdProfilesImpl(clientObject.getAfdProfiles(), this); + } + return afdProfiles; + } + + /** + * Gets the resource collection API of AfdCustomDomains. It manages AfdDomain. + * + * @return Resource collection API of AfdCustomDomains. + */ + public AfdCustomDomains afdCustomDomains() { + if (this.afdCustomDomains == null) { + this.afdCustomDomains = new AfdCustomDomainsImpl(clientObject.getAfdCustomDomains(), this); + } + return afdCustomDomains; + } + + /** + * Gets the resource collection API of AfdEndpoints. It manages AfdEndpoint. + * + * @return Resource collection API of AfdEndpoints. + */ + public AfdEndpoints afdEndpoints() { + if (this.afdEndpoints == null) { + this.afdEndpoints = new AfdEndpointsImpl(clientObject.getAfdEndpoints(), this); + } + return afdEndpoints; + } + + /** + * Gets the resource collection API of AfdOriginGroups. It manages AfdOriginGroup. + * + * @return Resource collection API of AfdOriginGroups. + */ + public AfdOriginGroups afdOriginGroups() { + if (this.afdOriginGroups == null) { + this.afdOriginGroups = new AfdOriginGroupsImpl(clientObject.getAfdOriginGroups(), this); + } + return afdOriginGroups; + } + + /** + * Gets the resource collection API of AfdOrigins. It manages AfdOrigin. + * + * @return Resource collection API of AfdOrigins. + */ + public AfdOrigins afdOrigins() { + if (this.afdOrigins == null) { + this.afdOrigins = new AfdOriginsImpl(clientObject.getAfdOrigins(), this); + } + return afdOrigins; + } + + /** + * Gets the resource collection API of Routes. It manages Route. + * + * @return Resource collection API of Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** + * Gets the resource collection API of RuleSets. + * + * @return Resource collection API of RuleSets. + */ + public RuleSets ruleSets() { + if (this.ruleSets == null) { + this.ruleSets = new RuleSetsImpl(clientObject.getRuleSets(), this); + } + return ruleSets; + } + + /** + * Gets the resource collection API of Rules. It manages Rule. + * + * @return Resource collection API of Rules. + */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(clientObject.getRules(), this); + } + return rules; + } + + /** + * Gets the resource collection API of SecurityPolicies. It manages SecurityPolicy. + * + * @return Resource collection API of SecurityPolicies. + */ + public SecurityPolicies securityPolicies() { + if (this.securityPolicies == null) { + this.securityPolicies = new SecurityPoliciesImpl(clientObject.getSecurityPolicies(), this); + } + return securityPolicies; + } + + /** + * Gets the resource collection API of Secrets. It manages Secret. + * + * @return Resource collection API of Secrets. + */ + public Secrets secrets() { + if (this.secrets == null) { + this.secrets = new SecretsImpl(clientObject.getSecrets(), this); + } + return secrets; + } + + /** + * Gets the resource collection API of LogAnalytics. + * + * @return Resource collection API of LogAnalytics. + */ + public LogAnalytics logAnalytics() { + if (this.logAnalytics == null) { + this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this); + } + return logAnalytics; + } + + /** + * Gets the resource collection API of Profiles. It manages Profile. + * + * @return Resource collection API of Profiles. + */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(clientObject.getProfiles(), this); + } + return profiles; + } + + /** + * Gets the resource collection API of Endpoints. It manages Endpoint. + * + * @return Resource collection API of Endpoints. + */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(clientObject.getEndpoints(), this); + } + return endpoints; + } + + /** + * Gets the resource collection API of Origins. It manages Origin. + * + * @return Resource collection API of Origins. + */ + public Origins origins() { + if (this.origins == null) { + this.origins = new OriginsImpl(clientObject.getOrigins(), this); + } + return origins; + } + + /** + * Gets the resource collection API of OriginGroups. It manages OriginGroup. + * + * @return Resource collection API of OriginGroups. + */ + public OriginGroups originGroups() { + if (this.originGroups == null) { + this.originGroups = new OriginGroupsImpl(clientObject.getOriginGroups(), this); + } + return originGroups; + } + + /** + * Gets the resource collection API of CustomDomains. It manages CustomDomain. + * + * @return Resource collection API of CustomDomains. + */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(clientObject.getCustomDomains(), this); + } + return customDomains; + } + + /** + * Gets the resource collection API of ResourceUsages. + * + * @return Resource collection API of ResourceUsages. + */ + public ResourceUsages resourceUsages() { + if (this.resourceUsages == null) { + this.resourceUsages = new ResourceUsagesImpl(clientObject.getResourceUsages(), this); + } + return resourceUsages; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of EdgeNodes. + * + * @return Resource collection API of EdgeNodes. + */ + public EdgeNodes edgeNodes() { + if (this.edgeNodes == null) { + this.edgeNodes = new EdgeNodesImpl(clientObject.getEdgeNodes(), this); + } + return edgeNodes; + } + + /** + * Gets the resource collection API of Policies. It manages CdnWebApplicationFirewallPolicy. + * + * @return Resource collection API of Policies. + */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + } + return policies; + } + + /** + * Gets the resource collection API of ManagedRuleSets. + * + * @return Resource collection API of ManagedRuleSets. + */ + public ManagedRuleSets managedRuleSets() { + if (this.managedRuleSets == null) { + this.managedRuleSets = new ManagedRuleSetsImpl(clientObject.getManagedRuleSets(), this); + } + return managedRuleSets; + } + + /** + * @return Wrapped service client CdnManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public CdnManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.java new file mode 100644 index 0000000000000..3ed0e6316da12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; + +/** An instance of this class provides access to all the operations defined in AfdCustomDomainsClient. */ +public interface AfdCustomDomainsClient { + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner get(String resourceGroupName, String profileName, String customDomainName); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginCreate( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner create( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain); + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner create( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginUpdate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdDomainInner> beginUpdate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner update( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties); + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdDomainInner update( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 profileName, String customDomainName, Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 profileName, String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefreshValidationToken( + String resourceGroupName, String profileName, String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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> beginRefreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshValidationToken(String resourceGroupName, String profileName, String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java new file mode 100644 index 0000000000000..fd7f5901b81a9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** An instance of this class provides access to all the operations defined in AfdEndpointsClient. */ +public interface AfdEndpointsClient { + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner get(String resourceGroupName, String profileName, String endpointName); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam); + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @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 azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner create( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdEndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @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 azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdEndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginPurgeContent( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @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> beginPurgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateCustomDomainOutputInner validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java new file mode 100644 index 0000000000000..2a2fd01e2c51a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; + +/** An instance of this class provides access to all the operations defined in AfdOriginGroupsClient. */ +public interface AfdOriginGroupsClient { + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 an existing origin group within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner get(String resourceGroupName, String profileName, String originGroupName); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginCreate( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner create( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @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 aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner create( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner update( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @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 aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginGroupInner update( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @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 profileName, String originGroupName, Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @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 profileName, String originGroupName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java new file mode 100644 index 0000000000000..c4b29f5ed850d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.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.cdn.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.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; + +/** An instance of this class provides access to all the operations defined in AfdOriginsClient. */ +public interface AfdOriginsClient { + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName); + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @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 an existing origin within an origin group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, String originName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner get(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginCreate( + String resourceGroupName, String profileName, String originGroupName, String originName, AfdOriginInner origin); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginCreate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner create( + String resourceGroupName, String profileName, String originGroupName, String originName, AfdOriginInner origin); + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @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 azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner create( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AfdOriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner update( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @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 azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AfdOriginInner update( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @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 profileName, String originGroupName, String originName, Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @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 profileName, String originGroupName, String originName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java new file mode 100644 index 0000000000000..e7ff569e7af3d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** An instance of this class provides access to all the operations defined in AfdProfilesClient. */ +public interface AfdProfilesClient { + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkHostnameAvailability( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @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 output of the validated secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateSecretWithResponse( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput, Context context); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateSecretOutputInner validateSecret( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpgrade( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner upgrade( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner upgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java new file mode 100644 index 0000000000000..b99d27a91b19d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for CdnManagementClient class. */ +public interface CdnManagementClient { + /** + * Gets Azure Subscription ID. + * + * @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 ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the AfdProfilesClient object to access its operations. + * + * @return the AfdProfilesClient object. + */ + AfdProfilesClient getAfdProfiles(); + + /** + * Gets the AfdCustomDomainsClient object to access its operations. + * + * @return the AfdCustomDomainsClient object. + */ + AfdCustomDomainsClient getAfdCustomDomains(); + + /** + * Gets the AfdEndpointsClient object to access its operations. + * + * @return the AfdEndpointsClient object. + */ + AfdEndpointsClient getAfdEndpoints(); + + /** + * Gets the AfdOriginGroupsClient object to access its operations. + * + * @return the AfdOriginGroupsClient object. + */ + AfdOriginGroupsClient getAfdOriginGroups(); + + /** + * Gets the AfdOriginsClient object to access its operations. + * + * @return the AfdOriginsClient object. + */ + AfdOriginsClient getAfdOrigins(); + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + RoutesClient getRoutes(); + + /** + * Gets the RuleSetsClient object to access its operations. + * + * @return the RuleSetsClient object. + */ + RuleSetsClient getRuleSets(); + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + RulesClient getRules(); + + /** + * Gets the SecurityPoliciesClient object to access its operations. + * + * @return the SecurityPoliciesClient object. + */ + SecurityPoliciesClient getSecurityPolicies(); + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + SecretsClient getSecrets(); + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + LogAnalyticsClient getLogAnalytics(); + + /** + * Gets the ProfilesClient object to access its operations. + * + * @return the ProfilesClient object. + */ + ProfilesClient getProfiles(); + + /** + * Gets the EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + EndpointsClient getEndpoints(); + + /** + * Gets the OriginsClient object to access its operations. + * + * @return the OriginsClient object. + */ + OriginsClient getOrigins(); + + /** + * Gets the OriginGroupsClient object to access its operations. + * + * @return the OriginGroupsClient object. + */ + OriginGroupsClient getOriginGroups(); + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + CustomDomainsClient getCustomDomains(); + + /** + * Gets the ResourceUsagesClient object to access its operations. + * + * @return the ResourceUsagesClient object. + */ + ResourceUsagesClient getResourceUsages(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the EdgeNodesClient object to access its operations. + * + * @return the EdgeNodesClient object. + */ + EdgeNodesClient getEdgeNodes(); + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + PoliciesClient getPolicies(); + + /** + * Gets the ManagedRuleSetsClient object to access its operations. + * + * @return the ManagedRuleSetsClient object. + */ + ManagedRuleSetsClient getManagedRuleSets(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java new file mode 100644 index 0000000000000..a1dcb798a32c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; + +/** An instance of this class provides access to all the operations defined in CustomDomainsClient. */ +public interface CustomDomainsClient { + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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 an existing custom domain within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner get(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner create( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties); + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner create( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, CustomDomainInner> beginDelete( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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, CustomDomainInner> beginDelete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginEnableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainInner> beginEnableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner enableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainInner enableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java new file mode 100644 index 0000000000000..69063e63c5f5e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; + +/** An instance of this class provides access to all the operations defined in EdgeNodesClient. */ +public interface EdgeNodesClient { + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java new file mode 100644 index 0000000000000..1915d69894e15 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java @@ -0,0 +1,678 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** An instance of this class provides access to all the operations defined in EndpointsClient. */ +public interface EndpointsClient { + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner get(String resourceGroupName, String profileName, String endpointName); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner create( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam); + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner create( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties); + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStart( + String resourceGroupName, String profileName, String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStart( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner start(String resourceGroupName, String profileName, String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner start(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStop( + String resourceGroupName, String profileName, String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointInner> beginStop( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner stop(String resourceGroupName, String profileName, String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointInner stop(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginPurgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @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> beginPurgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginLoadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @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> beginLoadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @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 loadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateCustomDomainOutputInner validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java new file mode 100644 index 0000000000000..ba3166e982eff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in LogAnalyticsClient. */ +public interface LogAnalyticsClient { + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @param groupBy Array of LogMetricsGroupBy. + * @param continents Array of Get9ItemsItem. + * @param countryOrRegions Array of Get10ItemsItem. + * @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 log report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions, + Context context); + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetricsResponseInner getLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains Array of String. + * @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 log analytics ranking report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + Context context); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RankingsResponseInner getLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsLocationsWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourcesResponseInner getLogAnalyticsResources(String resourceGroupName, String profileName); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions Array of WafAction. + * @param groupBy Array of WafRankingGroupBy. + * @param ruleTypes Array of WafRuleType. + * @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 waf related log analytics report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWafLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes, + Context context); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafMetricsResponseInner getWafLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @param actions Array of WafAction. + * @param ruleTypes Array of WafRuleType. + * @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 wAF log analytics charts for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWafLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafRankingsResponseInner getWafLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java new file mode 100644 index 0000000000000..3e8f9d3e3584c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; + +/** An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. */ +public interface ManagedRuleSetsClient { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all available managed rule 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 list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..bf09ac95cefa2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available CDN REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java new file mode 100644 index 0000000000000..cfd3845f77760 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; + +/** An instance of this class provides access to all the operations defined in OriginGroupsClient. */ +public interface OriginGroupsClient { + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 an existing origin group within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner get(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup); + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties); + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginGroupInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 profileName, String endpointName, String originGroupName, Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 profileName, String endpointName, String originGroupName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java new file mode 100644 index 0000000000000..98279f23d2f2b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; + +/** An instance of this class provides access to all the operations defined in OriginsClient. */ +public interface OriginsClient { + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @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 an existing origin within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner get(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner create( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin); + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties); + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OriginInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @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 profileName, String endpointName, String originName, Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @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 profileName, String endpointName, String originName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java new file mode 100644 index 0000000000000..a791b6eabff78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; + +/** An instance of this class provides access to all the operations defined in PoliciesClient. */ +public interface PoliciesClient { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @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 defines web application firewall policy for Azure CDN along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy); + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> beginUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CdnWebApplicationFirewallPolicyInner> beginUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner update( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters); + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CdnWebApplicationFirewallPolicyInner update( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @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 policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 policyName); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java new file mode 100644 index 0000000000000..507a7cbbdcc14 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ProfilesClient. */ +public interface ProfilesClient { + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile, Context context); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile); + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile, Context context); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters, Context context); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters, Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response canMigrateWithResponse( + String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginMigrate( + String resourceGroupName, MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrateResultInner> beginMigrate( + String resourceGroupName, MigrationParameters migrationParameters, Context context); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginMigrationCommit( + String resourceGroupName, String profileName, Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void migrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void migrationCommit(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsoUriInner generateSsoUri(String resourceGroupName, String profileName); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedOptimizationTypesListResultInner listSupportedOptimizationTypes( + String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..090793f2b8452 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkNameAvailabilityWithSubscription( + CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @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 output of the validate probe API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateProbeWithResponse( + ValidateProbeInput validateProbeInput, Context context); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateProbeOutputInner validateProbe(ValidateProbeInput validateProbeInput); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java new file mode 100644 index 0000000000000..b49bee9a6099e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; + +/** An instance of this class provides access to all the operations defined in ResourceUsagesClient. */ +public interface ResourceUsagesClient { + /** + * Check the quota and actual usage of the CDN profiles under the given 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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java new file mode 100644 index 0000000000000..e6da29fa8bdb0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; + +/** An instance of this class provides access to all the operations defined in RoutesClient. */ +public interface RoutesClient { + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @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 an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String routeName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner get(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner create( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route); + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @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 friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner create( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner update( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties); + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @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 friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner update( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @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 profileName, String endpointName, String routeName, Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @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 profileName, String endpointName, String routeName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java new file mode 100644 index 0000000000000..035342bc88a66 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in RuleSetsClient. */ +public interface RuleSetsClient { + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleSetInner get(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 friendly RuleSet name mapping to the any RuleSet or secret related information along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleSetInner create(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 profileName, String ruleSetName, Context context); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 profileName, String ruleSetName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String ruleSetName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java new file mode 100644 index 0000000000000..11318582fa16f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; + +/** An instance of this class provides access to all the operations defined in RulesClient. */ +public interface RulesClient { + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRuleSet( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @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 an existing delivery rule within a rule set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner get(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginCreate( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginCreate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner create(String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule); + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @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 friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner create( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginUpdate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RuleInner> beginUpdate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner update( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties); + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @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 friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleInner update( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @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 profileName, String ruleSetName, String ruleName, Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @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 profileName, String ruleSetName, String ruleName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java new file mode 100644 index 0000000000000..a030f0bed6206 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.SecretInner; + +/** An instance of this class provides access to all the operations defined in SecretsClient. */ +public interface SecretsClient { + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @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 an existing Secret within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String secretName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner get(String resourceGroupName, String profileName, String secretName); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretInner> beginCreate( + String resourceGroupName, String profileName, String secretName, SecretInner secret); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretInner> beginCreate( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret); + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @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 friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner create( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @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 profileName, String secretName, Context context); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @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 profileName, String secretName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java new file mode 100644 index 0000000000000..838edd9147fa5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; + +/** An instance of this class provides access to all the operations defined in SecurityPoliciesClient. */ +public interface SecurityPoliciesClient { + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @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 an existing security policy within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner get(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginCreate( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginCreate( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner create( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy); + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner create( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner patch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties); + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPolicyInner patch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @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 profileName, String securityPolicyName, Context context); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @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 profileName, String securityPolicyName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java new file mode 100644 index 0000000000000..835bc873dce37 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationProperties; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. + * www.contoso.com. + */ +@Fluent +public final class AfdDomainInner extends ProxyResource { + /* + * The JSON object that contains the properties of the domain to create. + */ + @JsonProperty(value = "properties") + private AfdDomainProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AfdDomainInner class. */ + public AfdDomainInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private AfdDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + public DomainValidationState domainValidationState() { + return this.innerProperties() == null ? null : this.innerProperties().domainValidationState(); + } + + /** + * Get the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); + return this; + } + + /** + * Get the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + public DomainValidationProperties validationProperties() { + return this.innerProperties() == null ? null : this.innerProperties().validationProperties(); + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tlsSettings(); + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withTlsSettings(tlsSettings); + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.innerProperties() == null ? null : this.innerProperties().azureDnsZone(); + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withAzureDnsZone(ResourceReference azureDnsZone) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withAzureDnsZone(azureDnsZone); + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().preValidatedCustomDomainResourceId(); + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainInner object itself. + */ + public AfdDomainInner withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainProperties(); + } + this.innerProperties().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java new file mode 100644 index 0000000000000..49b4e26f0273c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationProperties; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public final class AfdDomainProperties extends AfdDomainUpdatePropertiesParameters { + /* + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for + * DomainControlValidation. + */ + @JsonProperty(value = "domainValidationState", access = JsonProperty.Access.WRITE_ONLY) + private DomainValidationState domainValidationState; + + /* + * The host name of the domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /* + * Key-Value pair representing migration properties for domains. + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * Values the customer needs to validate domain ownership + */ + @JsonProperty(value = "validationProperties", access = JsonProperty.Access.WRITE_ONLY) + private DomainValidationProperties validationProperties; + + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of AfdDomainProperties class. */ + public AfdDomainProperties() { + } + + /** + * Get the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + public DomainValidationState domainValidationState() { + return this.domainValidationState; + } + + /** + * Get the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the AfdDomainProperties object itself. + */ + public AfdDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AfdDomainProperties object itself. + */ + public AfdDomainProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + public DomainValidationProperties validationProperties() { + return this.validationProperties; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public AfdDomainProperties withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + super.withTlsSettings(tlsSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdDomainProperties withAzureDnsZone(ResourceReference azureDnsZone) { + super.withAzureDnsZone(azureDnsZone); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdDomainProperties withPreValidatedCustomDomainResourceId( + ResourceReference preValidatedCustomDomainResourceId) { + super.withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property hostname in model AfdDomainProperties")); + } + if (validationProperties() != null) { + validationProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdDomainProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..90d15ebc84abd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainUpdatePropertiesParameters.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public class AfdDomainUpdatePropertiesParameters { + /* + * The name of the profile which holds the domain. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /* + * The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed certificate or + * user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed certificate by default. + */ + @JsonProperty(value = "tlsSettings") + private AfdDomainHttpsParameters tlsSettings; + + /* + * Resource reference to the Azure DNS zone + */ + @JsonProperty(value = "azureDnsZone") + private ResourceReference azureDnsZone; + + /* + * Resource reference to the Azure resource where custom domain ownership was prevalidated + */ + @JsonProperty(value = "preValidatedCustomDomainResourceId") + private ResourceReference preValidatedCustomDomainResourceId; + + /** Creates an instance of AfdDomainUpdatePropertiesParameters class. */ + public AfdDomainUpdatePropertiesParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.tlsSettings; + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + this.tlsSettings = tlsSettings; + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.azureDnsZone; + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters withAzureDnsZone(ResourceReference azureDnsZone) { + this.azureDnsZone = azureDnsZone; + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.preValidatedCustomDomainResourceId; + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainUpdatePropertiesParameters object itself. + */ + public AfdDomainUpdatePropertiesParameters withPreValidatedCustomDomainResourceId( + ResourceReference preValidatedCustomDomainResourceId) { + this.preValidatedCustomDomainResourceId = preValidatedCustomDomainResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tlsSettings() != null) { + tlsSettings().validate(); + } + if (azureDnsZone() != null) { + azureDnsZone().validate(); + } + if (preValidatedCustomDomainResourceId() != null) { + preValidatedCustomDomainResourceId().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.java new file mode 100644 index 0000000000000..5a8acf2ccacb4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration information such + * as origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format + * <endpointname>.azureedge.net. + */ +@Fluent +public final class AfdEndpointInner extends Resource { + /* + * The JSON object that contains the properties required to create an endpoint. + */ + @JsonProperty(value = "properties") + private AfdEndpointProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AfdEndpointInner class. */ + public AfdEndpointInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an endpoint. + * + * @return the innerProperties value. + */ + private AfdEndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public AfdEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.innerProperties() == null ? null : this.innerProperties().autoGeneratedDomainNameLabelScope(); + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the AfdEndpointInner object itself. + */ + public AfdEndpointInner withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointProperties(); + } + this.innerProperties().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the AfdEndpointInner object itself. + */ + public AfdEndpointInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointProperties(); + } + this.innerProperties().withEnabledState(enabledState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.java new file mode 100644 index 0000000000000..3e66f7416b9c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties required to create an endpoint. */ +@Fluent +public final class AfdEndpointProperties extends AfdEndpointPropertiesUpdateParameters { + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Indicates the endpoint name reuse scope. The default value is TenantReuse. + */ + @JsonProperty(value = "autoGeneratedDomainNameLabelScope") + private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope; + + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of AfdEndpointProperties class. */ + public AfdEndpointProperties() { + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the AfdEndpointProperties object itself. + */ + public AfdEndpointProperties withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public AfdEndpointProperties withEnabledState(EnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..21e3ad6d1a503 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointPropertiesUpdateParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object containing endpoint update parameters. */ +@Fluent +public class AfdEndpointPropertiesUpdateParameters { + /* + * The name of the profile which holds the endpoint. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "enabledState") + private EnabledState enabledState; + + /** Creates an instance of AfdEndpointPropertiesUpdateParameters class. */ + public AfdEndpointPropertiesUpdateParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the AfdEndpointPropertiesUpdateParameters object itself. + */ + public AfdEndpointPropertiesUpdateParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.java new file mode 100644 index 0000000000000..44e575bf8ae2b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.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.cdn.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.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from + * Azure Front Door. + */ +@Fluent +public final class AfdOriginGroupInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin group. + */ + @JsonProperty(value = "properties") + private AfdOriginGroupProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AfdOriginGroupInner class. */ + public AfdOriginGroupInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private AfdOriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancingSettings(); + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this + .innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.innerProperties() == null ? null : this.innerProperties().sessionAffinityState(); + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withSessionAffinityState(EnabledState sessionAffinityState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupProperties(); + } + this.innerProperties().withSessionAffinityState(sessionAffinityState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java new file mode 100644 index 0000000000000..cf15d1c95ecfd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public final class AfdOriginGroupProperties extends AfdOriginGroupUpdatePropertiesParameters { + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of AfdOriginGroupProperties class. */ + public AfdOriginGroupProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginGroupProperties withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + super.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + super + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginGroupProperties withSessionAffinityState(EnabledState sessionAffinityState) { + super.withSessionAffinityState(sessionAffinityState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..e22894660b8ff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupUpdatePropertiesParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public class AfdOriginGroupUpdatePropertiesParameters { + /* + * The name of the profile which holds the origin group. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /* + * Load balancing settings for a backend pool + */ + @JsonProperty(value = "loadBalancingSettings") + private LoadBalancingSettingsParameters loadBalancingSettings; + + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + @JsonProperty(value = "healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + * endpoint is added. Default is 10 mins. This property is currently not supported. + */ + @JsonProperty(value = "trafficRestorationTimeToHealedOrNewEndpointsInMinutes") + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "sessionAffinityState") + private EnabledState sessionAffinityState; + + /** Creates an instance of AfdOriginGroupUpdatePropertiesParameters class. */ + public AfdOriginGroupUpdatePropertiesParameters() { + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.loadBalancingSettings; + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withLoadBalancingSettings( + LoadBalancingSettingsParameters loadBalancingSettings) { + this.loadBalancingSettings = loadBalancingSettings; + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = + trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.sessionAffinityState; + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withSessionAffinityState(EnabledState sessionAffinityState) { + this.sessionAffinityState = sessionAffinityState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancingSettings() != null) { + loadBalancingSettings().validate(); + } + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java new file mode 100644 index 0000000000000..522fb90890fae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Front Door origin is the source of the content being delivered via Azure Front Door. When the edge nodes + * represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the + * configured origins. + */ +@Fluent +public final class AfdOriginInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin. + */ + @JsonProperty(value = "properties") + private AfdOriginProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AfdOriginInner class. */ + public AfdOriginInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private AfdOriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().originGroupName(); + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.innerProperties() == null ? null : this.innerProperties().azureOrigin(); + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withAzureOrigin(ResourceReference azureOrigin) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withAzureOrigin(azureOrigin); + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResource(); + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.innerProperties() == null ? null : this.innerProperties().enforceCertificateNameCheck(); + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginInner object itself. + */ + public AfdOriginInner withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginProperties(); + } + this.innerProperties().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java new file mode 100644 index 0000000000000..cda05d0d5f2e5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public final class AfdOriginProperties extends AfdOriginUpdatePropertiesParameters { + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of AfdOriginProperties class. */ + public AfdOriginProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withAzureOrigin(ResourceReference azureOrigin) { + super.withAzureOrigin(azureOrigin); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withHostname(String hostname) { + super.withHostname(hostname); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withHttpPort(Integer httpPort) { + super.withHttpPort(httpPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withHttpsPort(Integer httpsPort) { + super.withHttpsPort(httpsPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withWeight(Integer weight) { + super.withWeight(weight); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withSharedPrivateLinkResource( + SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + super.withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withEnabledState(EnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + super.withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..3d66e037975ff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginUpdatePropertiesParameters.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public class AfdOriginUpdatePropertiesParameters { + /* + * The name of the origin group which contains this origin. + */ + @JsonProperty(value = "originGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String originGroupName; + + /* + * Resource reference to the Azure origin resource. + */ + @JsonProperty(value = "azureOrigin") + private ResourceReference azureOrigin; + + /* + * The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique + * across all origins in an endpoint. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpsPort") + private Integer httpsPort; + + /* + * The host header value sent to the origin with each request. If you leave this blank, the request hostname + * determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud Services require this + * host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + */ + @JsonProperty(value = "originHostHeader") + private String originHostHeader; + + /* + * Priority of origin in given origin group for load balancing. Higher priorities will not be used for load + * balancing if any lower priority origin is healthy.Must be between 1 and 5 + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * The properties of the private link resource for private origin. + */ + @JsonProperty(value = "sharedPrivateLinkResource") + private SharedPrivateLinkResourceProperties sharedPrivateLinkResource; + + /* + * Whether to enable health probes to be made against backends defined under backendPools. Health probes can only + * be disabled if there is a single enabled backend in single enabled backend pool. + */ + @JsonProperty(value = "enabledState") + private EnabledState enabledState; + + /* + * Whether to enable certificate name check at origin level + */ + @JsonProperty(value = "enforceCertificateNameCheck") + private Boolean enforceCertificateNameCheck; + + /** Creates an instance of AfdOriginUpdatePropertiesParameters class. */ + public AfdOriginUpdatePropertiesParameters() { + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.originGroupName; + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.azureOrigin; + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withAzureOrigin(ResourceReference azureOrigin) { + this.azureOrigin = azureOrigin; + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.sharedPrivateLinkResource; + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withSharedPrivateLinkResource( + SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + this.sharedPrivateLinkResource = sharedPrivateLinkResource; + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.enforceCertificateNameCheck; + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginUpdatePropertiesParameters object itself. + */ + public AfdOriginUpdatePropertiesParameters withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + this.enforceCertificateNameCheck = enforceCertificateNameCheck; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureOrigin() != null) { + azureOrigin().validate(); + } + if (sharedPrivateLinkResource() != null) { + sharedPrivateLinkResource().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.java new file mode 100644 index 0000000000000..2c277ee34981c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CanMigrateResultInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateDefaultSku; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result for canMigrate operation. */ +@Fluent +public final class CanMigrateResultInner { + /* + * Flag that says if the profile can be migrated + */ + @JsonProperty(value = "canMigrate", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canMigrate; + + /* + * Recommended sku for the migration + */ + @JsonProperty(value = "defaultSku", access = JsonProperty.Access.WRITE_ONLY) + private CanMigrateDefaultSku defaultSku; + + /* + * The errors property. + */ + @JsonProperty(value = "errors") + private List errors; + + /** Creates an instance of CanMigrateResultInner class. */ + public CanMigrateResultInner() { + } + + /** + * Get the canMigrate property: Flag that says if the profile can be migrated. + * + * @return the canMigrate value. + */ + public Boolean canMigrate() { + return this.canMigrate; + } + + /** + * Get the defaultSku property: Recommended sku for the migration. + * + * @return the defaultSku value. + */ + public CanMigrateDefaultSku defaultSku() { + return this.defaultSku; + } + + /** + * Get the errors property: The errors property. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The errors property. + * + * @param errors the errors value to set. + * @return the CanMigrateResultInner object itself. + */ + public CanMigrateResultInner withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java new file mode 100644 index 0000000000000..5bf686b583f34 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.CdnEndpoint; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.PolicyResourceState; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.ProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines web application firewall policy for Azure CDN. */ +@Fluent +public final class CdnWebApplicationFirewallPolicyInner extends Resource { + /* + * Properties of the web application firewall policy. + */ + @JsonProperty(value = "properties") + private CdnWebApplicationFirewallPolicyProperties innerProperties; + + /* + * Gets a unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CdnWebApplicationFirewallPolicyInner class. */ + public CdnWebApplicationFirewallPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the web application firewall policy. + * + * @return the innerProperties value. + */ + private CdnWebApplicationFirewallPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Gets a unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @param sku the sku value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public CdnWebApplicationFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CdnWebApplicationFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.innerProperties() == null ? null : this.innerProperties().policySettings(); + } + + /** + * Set the policySettings property: Describes policySettings for policy. + * + * @param policySettings the policySettings value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withPolicySettings(PolicySettings policySettings) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withPolicySettings(policySettings); + return this; + } + + /** + * Get the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + public RateLimitRuleList rateLimitRules() { + return this.innerProperties() == null ? null : this.innerProperties().rateLimitRules(); + } + + /** + * Set the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @param rateLimitRules the rateLimitRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withRateLimitRules(RateLimitRuleList rateLimitRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withRateLimitRules(rateLimitRules); + return this; + } + + /** + * Get the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + public CustomRuleList customRules() { + return this.innerProperties() == null ? null : this.innerProperties().customRules(); + } + + /** + * Set the customRules property: Describes custom rules inside the policy. + * + * @param customRules the customRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withCustomRules(CustomRuleList customRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withCustomRules(customRules); + return this; + } + + /** + * Get the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + public ManagedRuleSetList managedRules() { + return this.innerProperties() == null ? null : this.innerProperties().managedRules(); + } + + /** + * Set the managedRules property: Describes managed rules inside the policy. + * + * @param managedRules the managedRules value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withManagedRules(ManagedRuleSetList managedRules) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withManagedRules(managedRules); + return this; + } + + /** + * Get the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + public List endpointLinks() { + return this.innerProperties() == null ? null : this.innerProperties().endpointLinks(); + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @param extendedProperties the extendedProperties value to set. + * @return the CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new CdnWebApplicationFirewallPolicyProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public PolicyResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model CdnWebApplicationFirewallPolicyInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnWebApplicationFirewallPolicyInner.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.java new file mode 100644 index 0000000000000..e67de7d7d44bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.CdnEndpoint; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.PolicyResourceState; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.ProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines CDN web application firewall policy properties. */ +@Fluent +public final class CdnWebApplicationFirewallPolicyProperties { + /* + * Describes policySettings for policy + */ + @JsonProperty(value = "policySettings") + private PolicySettings policySettings; + + /* + * Describes rate limit rules inside the policy. + */ + @JsonProperty(value = "rateLimitRules") + private RateLimitRuleList rateLimitRules; + + /* + * Describes custom rules inside the policy. + */ + @JsonProperty(value = "customRules") + private CustomRuleList customRules; + + /* + * Describes managed rules inside the policy. + */ + @JsonProperty(value = "managedRules") + private ManagedRuleSetList managedRules; + + /* + * Describes Azure CDN endpoints associated with this Web Application Firewall policy. + */ + @JsonProperty(value = "endpointLinks", access = JsonProperty.Access.WRITE_ONLY) + private List endpointLinks; + + /* + * Key-Value pair representing additional properties for Web Application Firewall policy. + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * Provisioning state of the WebApplicationFirewallPolicy. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private PolicyResourceState resourceState; + + /** Creates an instance of CdnWebApplicationFirewallPolicyProperties class. */ + public CdnWebApplicationFirewallPolicyProperties() { + } + + /** + * Get the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.policySettings; + } + + /** + * Set the policySettings property: Describes policySettings for policy. + * + * @param policySettings the policySettings value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withPolicySettings(PolicySettings policySettings) { + this.policySettings = policySettings; + return this; + } + + /** + * Get the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + public RateLimitRuleList rateLimitRules() { + return this.rateLimitRules; + } + + /** + * Set the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @param rateLimitRules the rateLimitRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withRateLimitRules(RateLimitRuleList rateLimitRules) { + this.rateLimitRules = rateLimitRules; + return this; + } + + /** + * Get the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + public CustomRuleList customRules() { + return this.customRules; + } + + /** + * Set the customRules property: Describes custom rules inside the policy. + * + * @param customRules the customRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withCustomRules(CustomRuleList customRules) { + this.customRules = customRules; + return this; + } + + /** + * Get the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + public ManagedRuleSetList managedRules() { + return this.managedRules; + } + + /** + * Set the managedRules property: Describes managed rules inside the policy. + * + * @param managedRules the managedRules value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withManagedRules(ManagedRuleSetList managedRules) { + this.managedRules = managedRules; + return this; + } + + /** + * Get the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + public List endpointLinks() { + return this.endpointLinks; + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @param extendedProperties the extendedProperties value to set. + * @return the CdnWebApplicationFirewallPolicyProperties object itself. + */ + public CdnWebApplicationFirewallPolicyProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public PolicyResourceState resourceState() { + return this.resourceState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policySettings() != null) { + policySettings().validate(); + } + if (rateLimitRules() != null) { + rateLimitRules().validate(); + } + if (customRules() != null) { + customRules().validate(); + } + if (managedRules() != null) { + managedRules().validate(); + } + if (endpointLinks() != null) { + endpointLinks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..c4c264b7914d8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckEndpointNameAvailabilityOutputInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check name availability API. */ +@Immutable +public final class CheckEndpointNameAvailabilityOutputInner { + /* + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * Returns the available hostname generated based on the AutoGeneratedDomainNameLabelScope when the name is + * available, otherwise it returns empty string + */ + @JsonProperty(value = "availableHostname", access = JsonProperty.Access.WRITE_ONLY) + private String availableHostname; + + /* + * The reason why the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The detailed error message describing why the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of CheckEndpointNameAvailabilityOutputInner class. */ + public CheckEndpointNameAvailabilityOutputInner() { + } + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the availableHostname property: Returns the available hostname generated based on the + * AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string. + * + * @return the availableHostname value. + */ + public String availableHostname() { + return this.availableHostname; + } + + /** + * Get the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckNameAvailabilityOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..bda26e96b22c9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckNameAvailabilityOutputInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check name availability API. */ +@Immutable +public final class CheckNameAvailabilityOutputInner { + /* + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * The reason why the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The detailed error message describing why the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of CheckNameAvailabilityOutputInner class. */ + public CheckNameAvailabilityOutputInner() { + } + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ContinentsResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ContinentsResponseInner.java new file mode 100644 index 0000000000000..be6a06a47727f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ContinentsResponseInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseContinentsItem; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseCountryOrRegionsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Continents Response. */ +@Fluent +public final class ContinentsResponseInner { + /* + * The continents property. + */ + @JsonProperty(value = "continents") + private List continents; + + /* + * The countryOrRegions property. + */ + @JsonProperty(value = "countryOrRegions") + private List countryOrRegions; + + /** Creates an instance of ContinentsResponseInner class. */ + public ContinentsResponseInner() { + } + + /** + * Get the continents property: The continents property. + * + * @return the continents value. + */ + public List continents() { + return this.continents; + } + + /** + * Set the continents property: The continents property. + * + * @param continents the continents value to set. + * @return the ContinentsResponseInner object itself. + */ + public ContinentsResponseInner withContinents(List continents) { + this.continents = continents; + return this; + } + + /** + * Get the countryOrRegions property: The countryOrRegions property. + * + * @return the countryOrRegions value. + */ + public List countryOrRegions() { + return this.countryOrRegions; + } + + /** + * Set the countryOrRegions property: The countryOrRegions property. + * + * @param countryOrRegions the countryOrRegions value to set. + * @return the ContinentsResponseInner object itself. + */ + public ContinentsResponseInner withCountryOrRegions(List countryOrRegions) { + this.countryOrRegions = countryOrRegions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (continents() != null) { + continents().forEach(e -> e.validate()); + } + if (countryOrRegions() != null) { + countryOrRegions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java new file mode 100644 index 0000000000000..d260ed67c8fdf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. + * www.contoso.com. + */ +@Fluent +public final class CustomDomainInner extends ProxyResource { + /* + * The JSON object that contains the properties of the custom domain to create. + */ + @JsonProperty(value = "properties") + private CustomDomainProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CustomDomainInner class. */ + public CustomDomainInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the custom domain to create. + * + * @return the innerProperties value. + */ + private CustomDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + public CustomDomainResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsProvisioningState(); + } + + /** + * Get the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsProvisioningSubstate(); + } + + /** + * Get the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + public CustomDomainHttpsParameters customHttpsParameters() { + return this.innerProperties() == null ? null : this.innerProperties().customHttpsParameters(); + } + + /** + * Set the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @param customHttpsParameters the customHttpsParameters value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withCustomHttpsParameters(CustomDomainHttpsParameters customHttpsParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withCustomHttpsParameters(customHttpsParameters); + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.innerProperties() == null ? null : this.innerProperties().validationData(); + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the CustomDomainInner object itself. + */ + public CustomDomainInner withValidationData(String validationData) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainProperties(); + } + this.innerProperties().withValidationData(validationData); + return this; + } + + /** + * Get the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + public CustomHttpsProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java new file mode 100644 index 0000000000000..414999f29c511 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the custom domain to create. */ +@Fluent +public final class CustomDomainProperties { + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /* + * Resource status of the custom domain. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomainResourceState resourceState; + + /* + * Provisioning status of the custom domain. + */ + @JsonProperty(value = "customHttpsProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningState customHttpsProvisioningState; + + /* + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. + */ + @JsonProperty(value = "customHttpsProvisioningSubstate", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /* + * Certificate parameters for securing custom HTTPS + */ + @JsonProperty(value = "customHttpsParameters") + private CustomDomainHttpsParameters customHttpsParameters; + + /* + * Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. + * E.g. ICP license number of a custom domain is required to deliver content in China. + */ + @JsonProperty(value = "validationData") + private String validationData; + + /* + * Provisioning status of Custom Https of the custom domain. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningState provisioningState; + + /** Creates an instance of CustomDomainProperties class. */ + public CustomDomainProperties() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + public CustomDomainResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.customHttpsProvisioningState; + } + + /** + * Get the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.customHttpsProvisioningSubstate; + } + + /** + * Get the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + public CustomDomainHttpsParameters customHttpsParameters() { + return this.customHttpsParameters; + } + + /** + * Set the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @param customHttpsParameters the customHttpsParameters value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCustomHttpsParameters(CustomDomainHttpsParameters customHttpsParameters) { + this.customHttpsParameters = customHttpsParameters; + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.validationData; + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Get the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + public CustomHttpsProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property hostname in model CustomDomainProperties")); + } + if (customHttpsParameters() != null) { + customHttpsParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.java new file mode 100644 index 0000000000000..15a961b7a4b37 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainPropertiesParameters.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the custom domain to create. */ +@Fluent +public final class CustomDomainPropertiesParameters { + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /** Creates an instance of CustomDomainPropertiesParameters class. */ + public CustomDomainPropertiesParameters() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainPropertiesParameters object itself. + */ + public CustomDomainPropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model CustomDomainPropertiesParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainPropertiesParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java new file mode 100644 index 0000000000000..b16f47f6fd008 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedCustomDomainProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the custom domain created on the CDN endpoint. */ +@Fluent +public final class DeepCreatedCustomDomainProperties { + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /* + * Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. + * E.g. ICP license number of a custom domain is required to deliver content in China. + */ + @JsonProperty(value = "validationData") + private String validationData; + + /** Creates an instance of DeepCreatedCustomDomainProperties class. */ + public DeepCreatedCustomDomainProperties() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedCustomDomainProperties object itself. + */ + public DeepCreatedCustomDomainProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.validationData; + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the DeepCreatedCustomDomainProperties object itself. + */ + public DeepCreatedCustomDomainProperties withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model DeepCreatedCustomDomainProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedCustomDomainProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java new file mode 100644 index 0000000000000..fa71cca3ca9a9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginGroupProperties.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the origin group created on the CDN endpoint. */ +@Fluent +public final class DeepCreatedOriginGroupProperties { + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + @JsonProperty(value = "healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin group. + */ + @JsonProperty(value = "origins", required = true) + private List origins; + + /* + * Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + * endpoint is added. Default is 10 mins. This property is currently not supported. + */ + @JsonProperty(value = "trafficRestorationTimeToHealedOrNewEndpointsInMinutes") + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * The JSON object that contains the properties to determine origin health using real requests/responses.This + * property is currently not supported. + */ + @JsonProperty(value = "responseBasedOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** Creates an instance of DeepCreatedOriginGroupProperties class. */ + public DeepCreatedOriginGroupProperties() { + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = + trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.responseBasedOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the DeepCreatedOriginGroupProperties object itself. + */ + public DeepCreatedOriginGroupProperties withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + if (origins() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property origins in model DeepCreatedOriginGroupProperties")); + } else { + origins().forEach(e -> e.validate()); + } + if (responseBasedOriginErrorDetectionSettings() != null) { + responseBasedOriginErrorDetectionSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginGroupProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java new file mode 100644 index 0000000000000..e0c118b9436ca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/DeepCreatedOriginProperties.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the origin created on the CDN endpoint. */ +@Fluent +public final class DeepCreatedOriginProperties { + /* + * The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. This should be unique across + * all origins in an endpoint. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpsPort") + private Integer httpsPort; + + /* + * The host header value sent to the origin with each request. If you leave this blank, the request hostname + * determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host + * header value to match the origin hostname by default. + */ + @JsonProperty(value = "originHostHeader") + private String originHostHeader; + + /* + * Priority of origin in given origin group for load balancing. Higher priorities will not be used for load + * balancing if any lower priority origin is healthy.Must be between 1 and 5. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Origin is enabled for load balancing or not. By default, origin is always enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + */ + @JsonProperty(value = "privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is + * 'Private' + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "privateLinkLocation") + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to the Private Link. + */ + @JsonProperty(value = "privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /* + * The approval status for the connection to the Private Link + */ + @JsonProperty(value = "privateEndpointStatus", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointStatus privateEndpointStatus; + + /** Creates an instance of DeepCreatedOriginProperties class. */ + public DeepCreatedOriginProperties() { + } + + /** + * Get the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @param enabled the enabled value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.privateLinkAlias; + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkAlias(String privateLinkAlias) { + this.privateLinkAlias = privateLinkAlias; + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.privateLinkApprovalMessage; + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the DeepCreatedOriginProperties object itself. + */ + public DeepCreatedOriginProperties withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.privateEndpointStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model DeepCreatedOriginProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.java new file mode 100644 index 0000000000000..0f449df9cf899 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.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.cdn.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.cdn.generated.models.IpAddressGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. */ +@Fluent +public final class EdgeNodeInner extends ProxyResource { + /* + * The JSON object that contains the properties required to create an edgenode. + */ + @JsonProperty(value = "properties") + private EdgeNodeProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of EdgeNodeInner class. */ + public EdgeNodeInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an edgenode. + * + * @return the innerProperties value. + */ + private EdgeNodeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + public List ipAddressGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressGroups(); + } + + /** + * Set the ipAddressGroups property: List of ip address groups. + * + * @param ipAddressGroups the ipAddressGroups value to set. + * @return the EdgeNodeInner object itself. + */ + public EdgeNodeInner withIpAddressGroups(List ipAddressGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new EdgeNodeProperties(); + } + this.innerProperties().withIpAddressGroups(ipAddressGroups); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.java new file mode 100644 index 0000000000000..6658130fb3896 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create an edgenode. */ +@Fluent +public final class EdgeNodeProperties { + /* + * List of ip address groups. + */ + @JsonProperty(value = "ipAddressGroups", required = true) + private List ipAddressGroups; + + /** Creates an instance of EdgeNodeProperties class. */ + public EdgeNodeProperties() { + } + + /** + * Get the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + public List ipAddressGroups() { + return this.ipAddressGroups; + } + + /** + * Set the ipAddressGroups property: List of ip address groups. + * + * @param ipAddressGroups the ipAddressGroups value to set. + * @return the EdgeNodeProperties object itself. + */ + public EdgeNodeProperties withIpAddressGroups(List ipAddressGroups) { + this.ipAddressGroups = ipAddressGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressGroups() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipAddressGroups in model EdgeNodeProperties")); + } else { + ipAddressGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EdgeNodeProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java new file mode 100644 index 0000000000000..e0900c4a47e52 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, + * content caching and delivery behavior. The CDN endpoint uses the URL format <endpointname>.azureedge.net. + */ +@Fluent +public final class EndpointInner extends Resource { + /* + * The JSON object that contains the properties required to create an endpoint. + */ + @JsonProperty(value = "properties") + private EndpointProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of EndpointInner class. */ + public EndpointInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create an endpoint. + * + * @return the innerProperties value. + */ + private EndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public EndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN. + * + * @param origins the origins value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + public List originGroups() { + return this.innerProperties() == null ? null : this.innerProperties().originGroups(); + } + + /** + * Set the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @param originGroups the originGroups value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginGroups(List originGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginGroups(originGroups); + return this; + } + + /** + * Get the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Get the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + public EndpointResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + public EndpointProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.innerProperties() == null ? null : this.innerProperties().contentTypesToCompress(); + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withContentTypesToCompress(List contentTypesToCompress) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isCompressionEnabled(); + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpAllowed(); + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpAllowed(Boolean isHttpAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpsAllowed(); + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().queryStringCachingBehavior(); + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.innerProperties() == null ? null : this.innerProperties().optimizationType(); + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withOptimizationType(OptimizationType optimizationType) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withOptimizationType(optimizationType); + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.innerProperties() == null ? null : this.innerProperties().probePath(); + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withProbePath(String probePath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withProbePath(probePath); + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.innerProperties() == null ? null : this.innerProperties().geoFilters(); + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withGeoFilters(List geoFilters) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withGeoFilters(geoFilters); + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.innerProperties() == null ? null : this.innerProperties().defaultOriginGroup(); + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.innerProperties() == null ? null : this.innerProperties().urlSigningKeys(); + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withUrlSigningKeys(List urlSigningKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryPolicy(); + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerProperties() == null ? null : this.innerProperties().webApplicationFirewallPolicyLink(); + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointInner object itself. + */ + public EndpointInner withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointProperties(); + } + this.innerProperties().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java new file mode 100644 index 0000000000000..8088824aceef6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointProperties.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties required to create an endpoint. */ +@Fluent +public final class EndpointProperties extends EndpointPropertiesUpdateParameters { + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The source of the content being delivered via CDN. + */ + @JsonProperty(value = "origins", required = true) + private List origins; + + /* + * The origin groups comprising of origins that are used for load balancing the traffic based on availability. + */ + @JsonProperty(value = "originGroups") + private List originGroups; + + /* + * The custom domains under the endpoint. + */ + @JsonProperty(value = "customDomains", access = JsonProperty.Access.WRITE_ONLY) + private List customDomains; + + /* + * Resource status of the endpoint. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private EndpointResourceState resourceState; + + /* + * Provisioning status of the endpoint. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EndpointProvisioningState provisioningState; + + /** Creates an instance of EndpointProperties class. */ + public EndpointProperties() { + } + + /** + * Get the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN. + * + * @param origins the origins value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + public List originGroups() { + return this.originGroups; + } + + /** + * Set the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @param originGroups the originGroups value to set. + * @return the EndpointProperties object itself. + */ + public EndpointProperties withOriginGroups(List originGroups) { + this.originGroups = originGroups; + return this; + } + + /** + * Get the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Get the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + public EndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + public EndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withOriginPath(String originPath) { + super.withOriginPath(originPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withContentTypesToCompress(List contentTypesToCompress) { + super.withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withIsCompressionEnabled(Boolean isCompressionEnabled) { + super.withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withIsHttpAllowed(Boolean isHttpAllowed) { + super.withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withIsHttpsAllowed(Boolean isHttpsAllowed) { + super.withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + super.withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withOptimizationType(OptimizationType optimizationType) { + super.withOptimizationType(optimizationType); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withProbePath(String probePath) { + super.withProbePath(probePath); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withGeoFilters(List geoFilters) { + super.withGeoFilters(geoFilters); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + super.withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withUrlSigningKeys(List urlSigningKeys) { + super.withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + super.withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public EndpointProperties withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + super.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (origins() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property origins in model EndpointProperties")); + } else { + origins().forEach(e -> e.validate()); + } + if (originGroups() != null) { + originGroups().forEach(e -> e.validate()); + } + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointProperties.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..9e7614ca07dd8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointPropertiesUpdateParameters.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object containing endpoint update parameters. */ +@Fluent +public class EndpointPropertiesUpdateParameters { + /* + * A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "originPath") + private String originPath; + + /* + * List of content types on which compression applies. The value should be a valid MIME type. + */ + @JsonProperty(value = "contentTypesToCompress") + private List contentTypesToCompress; + + /* + * The host header value sent to the origin with each request. This property at Endpoint is only allowed when + * endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + */ + @JsonProperty(value = "originHostHeader") + private String originHostHeader; + + /* + * Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, + * content will be served as compressed if user requests for a compressed version. Content won't be compressed on + * CDN when requested content is smaller than 1 byte or larger than 1 MB. + */ + @JsonProperty(value = "isCompressionEnabled") + private Boolean isCompressionEnabled; + + /* + * Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or + * HTTPS) must be allowed. + */ + @JsonProperty(value = "isHttpAllowed") + private Boolean isHttpAllowed; + + /* + * Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP + * or HTTPS) must be allowed. + */ + @JsonProperty(value = "isHttpsAllowed") + private Boolean isHttpsAllowed; + + /* + * Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, + * bypass caching to prevent requests that contain query strings from being cached, or cache every request with a + * unique URL. + */ + @JsonProperty(value = "queryStringCachingBehavior") + private QueryStringCachingBehavior queryStringCachingBehavior; + + /* + * Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. + * With this information, CDN can apply scenario driven optimization. + */ + @JsonProperty(value = "optimizationType") + private OptimizationType optimizationType; + + /* + * Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the + * most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using + * a single origin. + */ + @JsonProperty(value = "probePath") + private String probePath; + + /* + * List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a + * specified path or content, e.g. block APAC for path /pictures/ + */ + @JsonProperty(value = "geoFilters") + private List geoFilters; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "defaultOriginGroup") + private ResourceReference defaultOriginGroup; + + /* + * List of keys used to validate the signed URL hashes. + */ + @JsonProperty(value = "urlSigningKeys") + private List urlSigningKeys; + + /* + * A policy that specifies the delivery rules to be used for an endpoint. + */ + @JsonProperty(value = "deliveryPolicy") + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /* + * Defines the Web Application Firewall policy for the endpoint (if applicable) + */ + @JsonProperty(value = "webApplicationFirewallPolicyLink") + private EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /** Creates an instance of EndpointPropertiesUpdateParameters class. */ + public EndpointPropertiesUpdateParameters() { + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.originPath; + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.isHttpAllowed; + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsHttpAllowed(Boolean isHttpAllowed) { + this.isHttpAllowed = isHttpAllowed; + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.isHttpsAllowed; + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withIsHttpsAllowed(Boolean isHttpsAllowed) { + this.isHttpsAllowed = isHttpsAllowed; + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withQueryStringCachingBehavior( + QueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.optimizationType; + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withOptimizationType(OptimizationType optimizationType) { + this.optimizationType = optimizationType; + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.geoFilters; + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withGeoFilters(List geoFilters) { + this.geoFilters = geoFilters; + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.defaultOriginGroup; + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + this.defaultOriginGroup = defaultOriginGroup; + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.urlSigningKeys; + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withUrlSigningKeys(List urlSigningKeys) { + this.urlSigningKeys = urlSigningKeys; + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.deliveryPolicy; + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withDeliveryPolicy( + EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + this.deliveryPolicy = deliveryPolicy; + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.webApplicationFirewallPolicyLink; + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointPropertiesUpdateParameters object itself. + */ + public EndpointPropertiesUpdateParameters withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (geoFilters() != null) { + geoFilters().forEach(e -> e.validate()); + } + if (defaultOriginGroup() != null) { + defaultOriginGroup().validate(); + } + if (urlSigningKeys() != null) { + urlSigningKeys().forEach(e -> e.validate()); + } + if (deliveryPolicy() != null) { + deliveryPolicy().validate(); + } + if (webApplicationFirewallPolicyLink() != null) { + webApplicationFirewallPolicyLink().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.java new file mode 100644 index 0000000000000..f67ab602fc144 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a managed rule set definition. */ +@Fluent +public final class ManagedRuleSetDefinitionInner extends ProxyResource { + /* + * Describes managed rule set definition properties. + */ + @JsonProperty(value = "properties") + private ManagedRuleSetDefinitionProperties innerProperties; + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ManagedRuleSetDefinitionInner class. */ + public ManagedRuleSetDefinitionInner() { + } + + /** + * Get the innerProperties property: Describes managed rule set definition properties. + * + * @return the innerProperties value. + */ + private ManagedRuleSetDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @param sku the sku value to set. + * @return the ManagedRuleSetDefinitionInner object itself. + */ + public ManagedRuleSetDefinitionInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetType(); + } + + /** + * Get the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetVersion(); + } + + /** + * Get the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ruleGroups(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.java new file mode 100644 index 0000000000000..afbce82431049 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties for a managed rule set definition. */ +@Immutable +public final class ManagedRuleSetDefinitionProperties { + /* + * Provisioning state of the managed rule set. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Type of the managed rule set. + */ + @JsonProperty(value = "ruleSetType", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetType; + + /* + * Version of the managed rule set type. + */ + @JsonProperty(value = "ruleSetVersion", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetVersion; + + /* + * Rule groups of the managed rule set. + */ + @JsonProperty(value = "ruleGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ruleGroups; + + /** Creates an instance of ManagedRuleSetDefinitionProperties class. */ + public ManagedRuleSetDefinitionProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Get the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Get the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MetricsResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MetricsResponseInner.java new file mode 100644 index 0000000000000..147e997f282a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MetricsResponseInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.MetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseSeriesItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Metrics Response. */ +@Fluent +public final class MetricsResponseInner { + /* + * The dateTimeBegin property. + */ + @JsonProperty(value = "dateTimeBegin") + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + @JsonProperty(value = "dateTimeEnd") + private OffsetDateTime dateTimeEnd; + + /* + * The granularity property. + */ + @JsonProperty(value = "granularity") + private MetricsGranularity granularity; + + /* + * The series property. + */ + @JsonProperty(value = "series") + private List series; + + /** Creates an instance of MetricsResponseInner class. */ + public MetricsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the granularity property: The granularity property. + * + * @return the granularity value. + */ + public MetricsGranularity granularity() { + return this.granularity; + } + + /** + * Set the granularity property: The granularity property. + * + * @param granularity the granularity value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withGranularity(MetricsGranularity granularity) { + this.granularity = granularity; + return this; + } + + /** + * Get the series property: The series property. + * + * @return the series value. + */ + public List series() { + return this.series; + } + + /** + * Set the series property: The series property. + * + * @param series the series value to set. + * @return the MetricsResponseInner object itself. + */ + public MetricsResponseInner withSeries(List series) { + this.series = series; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (series() != null) { + series().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.java new file mode 100644 index 0000000000000..85b5d143bc628 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MigrateResultInner.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result for migrate operation. */ +@Fluent +public final class MigrateResultInner { + /* + * Arm resource id of the migrated profile + */ + @JsonProperty(value = "migratedProfileResourceId", access = JsonProperty.Access.WRITE_ONLY) + private ResourceReference migratedProfileResourceId; + + /* + * The errors property. + */ + @JsonProperty(value = "errors") + private List errors; + + /** Creates an instance of MigrateResultInner class. */ + public MigrateResultInner() { + } + + /** + * Get the migratedProfileResourceId property: Arm resource id of the migrated profile. + * + * @return the migratedProfileResourceId value. + */ + public ResourceReference migratedProfileResourceId() { + return this.migratedProfileResourceId; + } + + /** + * Get the errors property: The errors property. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The errors property. + * + * @param errors the errors value to set. + * @return the MigrateResultInner object itself. + */ + public MigrateResultInner withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migratedProfileResourceId() != null) { + migratedProfileResourceId().validate(); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..45e9a2bad2437 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.OperationDisplay; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CDN REST API operation. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The origin of operations. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * Properties of operation, include metric specifications. + */ + @JsonProperty(value = "properties") + private OperationProperties innerOperationProperties; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the innerOperationProperties property: Properties of operation, include metric specifications. + * + * @return the innerOperationProperties value. + */ + private OperationProperties innerOperationProperties() { + return this.innerOperationProperties; + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + if (this.innerOperationProperties() == null) { + this.innerOperationProperties = new OperationProperties(); + } + this.innerOperationProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerOperationProperties() != null) { + innerOperationProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.java new file mode 100644 index 0000000000000..2e8f6d9c42640 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of operation, include metric specifications. */ +@Fluent +public final class OperationProperties { + /* + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** Creates an instance of OperationProperties class. */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.java new file mode 100644 index 0000000000000..11d4e7f3d57cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. + */ +@Fluent +public final class OriginGroupInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin group. + */ + @JsonProperty(value = "properties") + private OriginGroupProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of OriginGroupInner class. */ + public OriginGroupInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private OriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + public OriginGroupResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + public OriginGroupProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this + .innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupInner object itself. + */ + public OriginGroupInner withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupProperties(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.java new file mode 100644 index 0000000000000..be17f1e35cf55 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public final class OriginGroupProperties extends OriginGroupUpdatePropertiesParameters { + /* + * Resource status of the origin group. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private OriginGroupResourceState resourceState; + + /* + * Provisioning status of the origin group. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private OriginGroupProvisioningState provisioningState; + + /** Creates an instance of OriginGroupProperties class. */ + public OriginGroupProperties() { + } + + /** + * Get the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + public OriginGroupResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + public OriginGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public OriginGroupProperties withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + super.withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginGroupProperties withOrigins(List origins) { + super.withOrigins(origins); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginGroupProperties withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + super + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginGroupProperties withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + super.withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..b104c69da27f1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupUpdatePropertiesParameters.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public class OriginGroupUpdatePropertiesParameters { + /* + * Health probe settings to the origin that is used to determine the health of the origin. + */ + @JsonProperty(value = "healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin group. + */ + @JsonProperty(value = "origins") + private List origins; + + /* + * Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + * endpoint is added. Default is 10 mins. This property is currently not supported. + */ + @JsonProperty(value = "trafficRestorationTimeToHealedOrNewEndpointsInMinutes") + private Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + + /* + * The JSON object that contains the properties to determine origin health using real requests/responses. This + * property is currently not supported. + */ + @JsonProperty(value = "responseBasedOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** Creates an instance of OriginGroupUpdatePropertiesParameters class. */ + public OriginGroupUpdatePropertiesParameters() { + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.healthProbeSettings; + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + this.healthProbeSettings = healthProbeSettings; + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = + trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.responseBasedOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupUpdatePropertiesParameters object itself. + */ + public OriginGroupUpdatePropertiesParameters withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbeSettings() != null) { + healthProbeSettings().validate(); + } + if (origins() != null) { + origins().forEach(e -> e.validate()); + } + if (responseBasedOriginErrorDetectionSettings() != null) { + responseBasedOriginErrorDetectionSettings().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.java new file mode 100644 index 0000000000000..e284c3c331666 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.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.cdn.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.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do + * not have the requested content cached, they attempt to fetch it from one or more of the configured origins. + */ +@Fluent +public final class OriginInner extends ProxyResource { + /* + * The JSON object that contains the properties of the origin. + */ + @JsonProperty(value = "properties") + private OriginProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of OriginInner class. */ + public OriginInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private OriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + public OriginResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + public OriginProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointStatus(); + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginInner object itself. + */ + public OriginInner withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginInner object itself. + */ + public OriginInner withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginInner object itself. + */ + public OriginInner withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginInner object itself. + */ + public OriginInner withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginInner object itself. + */ + public OriginInner withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginProperties(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java new file mode 100644 index 0000000000000..93c33aad17f50 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public final class OriginProperties extends OriginUpdatePropertiesParameters { + /* + * Resource status of the origin. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private OriginResourceState resourceState; + + /* + * Provisioning status of the origin. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private OriginProvisioningState provisioningState; + + /* + * The approval status for the connection to the Private Link + */ + @JsonProperty(value = "privateEndpointStatus", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointStatus privateEndpointStatus; + + /** Creates an instance of OriginProperties class. */ + public OriginProperties() { + } + + /** + * Get the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + public OriginResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + public OriginProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.privateEndpointStatus; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withHostname(String hostname) { + super.withHostname(hostname); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withHttpPort(Integer httpPort) { + super.withHttpPort(httpPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withHttpsPort(Integer httpsPort) { + super.withHttpsPort(httpsPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withOriginHostHeader(String originHostHeader) { + super.withOriginHostHeader(originHostHeader); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withWeight(Integer weight) { + super.withWeight(weight); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withEnabled(Boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withPrivateLinkAlias(String privateLinkAlias) { + super.withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withPrivateLinkResourceId(String privateLinkResourceId) { + super.withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withPrivateLinkLocation(String privateLinkLocation) { + super.withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public OriginProperties withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + super.withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..638e1d1366603 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginUpdatePropertiesParameters.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public class OriginUpdatePropertiesParameters { + /* + * The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique + * across all origins in an endpoint. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "httpsPort") + private Integer httpsPort; + + /* + * The host header value sent to the origin with each request. If you leave this blank, the request hostname + * determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host + * header value to match the origin hostname by default. This overrides the host header defined at Endpoint + */ + @JsonProperty(value = "originHostHeader") + private String originHostHeader; + + /* + * Priority of origin in given origin group for load balancing. Higher priorities will not be used for load + * balancing if any lower priority origin is healthy.Must be between 1 and 5 + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Origin is enabled for load balancing or not + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + */ + @JsonProperty(value = "privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is + * 'Private' + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "privateLinkLocation") + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to the Private Link. + */ + @JsonProperty(value = "privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /** Creates an instance of OriginUpdatePropertiesParameters class. */ + public OriginUpdatePropertiesParameters() { + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.originHostHeader; + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withOriginHostHeader(String originHostHeader) { + this.originHostHeader = originHostHeader; + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.privateLinkAlias; + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkAlias(String privateLinkAlias) { + this.privateLinkAlias = privateLinkAlias; + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.privateLinkApprovalMessage; + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginUpdatePropertiesParameters object itself. + */ + public OriginUpdatePropertiesParameters withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.java new file mode 100644 index 0000000000000..6bac89189fbe2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A profile is a logical grouping of endpoints that share the same settings. */ +@Fluent +public final class ProfileInner extends Resource { + /* + * The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list and rate) of the + * profile. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD profile. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Managed service identity (system assigned and/or user assigned identities). + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * The JSON object that contains the properties required to create a profile. + */ + @JsonProperty(value = "properties") + private ProfileProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ProfileInner class. */ + public ProfileInner() { + } + + /** + * Get the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @param sku the sku value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD + * profile. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The JSON object that contains the properties required to create a profile. + * + * @return the innerProperties value. + */ + private ProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + public ProfileResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + public ProfileProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @param extendedProperties the extendedProperties value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfileProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); + return this; + } + + /** + * Get the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + public String frontDoorId() { + return this.innerProperties() == null ? null : this.innerProperties().frontDoorId(); + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().originResponseTimeoutSeconds(); + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileInner object itself. + */ + public ProfileInner withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfileProperties(); + } + this.innerProperties().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model ProfileInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileInner.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.java new file mode 100644 index 0000000000000..f3237c01bc013 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The JSON object that contains the properties required to create a profile. */ +@Fluent +public final class ProfileProperties { + /* + * Resource status of the profile. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ProfileResourceState resourceState; + + /* + * Provisioning status of the profile. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProfileProvisioningState provisioningState; + + /* + * Key-Value pair representing additional properties for profiles. + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * The Id of the frontdoor. + */ + @JsonProperty(value = "frontDoorId", access = JsonProperty.Access.WRITE_ONLY) + private String frontDoorId; + + /* + * Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and + * returns. + */ + @JsonProperty(value = "originResponseTimeoutSeconds") + private Integer originResponseTimeoutSeconds; + + /** Creates an instance of ProfileProperties class. */ + public ProfileProperties() { + } + + /** + * Get the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + public ProfileResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + public ProfileProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @param extendedProperties the extendedProperties value to set. + * @return the ProfileProperties object itself. + */ + public ProfileProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + public String frontDoorId() { + return this.frontDoorId; + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.originResponseTimeoutSeconds; + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileProperties object itself. + */ + public ProfileProperties withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.java new file mode 100644 index 0000000000000..defb8bba0d302 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfilePropertiesUpdateParameters.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object containing profile update parameters. */ +@Fluent +public final class ProfilePropertiesUpdateParameters { + /* + * Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and + * returns. + */ + @JsonProperty(value = "originResponseTimeoutSeconds") + private Integer originResponseTimeoutSeconds; + + /** Creates an instance of ProfilePropertiesUpdateParameters class. */ + public ProfilePropertiesUpdateParameters() { + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.originResponseTimeoutSeconds; + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfilePropertiesUpdateParameters object itself. + */ + public ProfilePropertiesUpdateParameters withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RankingsResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RankingsResponseInner.java new file mode 100644 index 0000000000000..fb6d83f302dc2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RankingsResponseInner.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponseTablesItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Rankings Response. */ +@Fluent +public final class RankingsResponseInner { + /* + * The dateTimeBegin property. + */ + @JsonProperty(value = "dateTimeBegin") + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + @JsonProperty(value = "dateTimeEnd") + private OffsetDateTime dateTimeEnd; + + /* + * The tables property. + */ + @JsonProperty(value = "tables") + private List tables; + + /** Creates an instance of RankingsResponseInner class. */ + public RankingsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the tables property: The tables property. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Set the tables property: The tables property. + * + * @param tables the tables value to set. + * @return the RankingsResponseInner object itself. + */ + public RankingsResponseInner withTables(List tables) { + this.tables = tables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.java new file mode 100644 index 0000000000000..9966a653e5dd2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageUnit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check resource usage API. */ +@Immutable +public final class ResourceUsageInner { + /* + * Resource type for which the usage is provided. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * Unit of the usage. e.g. count. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private ResourceUsageUnit unit; + + /* + * Actual value of usage on the specified resource type. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /* + * Quota of the specified resource type. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** Creates an instance of ResourceUsageInner class. */ + public ResourceUsageInner() { + } + + /** + * Get the resourceType property: Resource type for which the usage is provided. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the unit property: Unit of the usage. e.g. count. + * + * @return the unit value. + */ + public ResourceUsageUnit unit() { + return this.unit; + } + + /** + * Get the currentValue property: Actual value of usage on the specified resource type. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: Quota of the specified resource type. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourcesResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourcesResponseInner.java new file mode 100644 index 0000000000000..037f70410546d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourcesResponseInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseCustomDomainsItem; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseEndpointsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resources Response. */ +@Fluent +public final class ResourcesResponseInner { + /* + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The customDomains property. + */ + @JsonProperty(value = "customDomains") + private List customDomains; + + /** Creates an instance of ResourcesResponseInner class. */ + public ResourcesResponseInner() { + } + + /** + * Get the endpoints property: The endpoints property. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints property. + * + * @param endpoints the endpoints value to set. + * @return the ResourcesResponseInner object itself. + */ + public ResourcesResponseInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the customDomains property: The customDomains property. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: The customDomains property. + * + * @param customDomains the customDomains value to set. + * @return the ResourcesResponseInner object itself. + */ + public ResourcesResponseInner withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java new file mode 100644 index 0000000000000..921500e26c93c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Friendly Routes name mapping to the any Routes or secret related information. */ +@Fluent +public final class RouteInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Routes to create. + */ + @JsonProperty(value = "properties") + private RouteProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RouteInner class. */ + public RouteInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Routes to create. + * + * @return the innerProperties value. + */ + private RouteProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.innerProperties() == null ? null : this.innerProperties().endpointName(); + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteInner object itself. + */ + public RouteInner withCustomDomains(List customDomains) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withCustomDomains(customDomains); + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.innerProperties() == null ? null : this.innerProperties().originGroup(); + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteInner object itself. + */ + public RouteInner withOriginGroup(ResourceReference originGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withOriginGroup(originGroup); + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteInner object itself. + */ + public RouteInner withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSets(); + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteInner object itself. + */ + public RouteInner withRuleSets(List ruleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withRuleSets(ruleSets); + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().supportedProtocols(); + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteInner object itself. + */ + public RouteInner withSupportedProtocols(List supportedProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withSupportedProtocols(supportedProtocols); + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.innerProperties() == null ? null : this.innerProperties().patternsToMatch(); + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteInner object itself. + */ + public RouteInner withPatternsToMatch(List patternsToMatch) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withPatternsToMatch(patternsToMatch); + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().cacheConfiguration(); + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteInner object itself. + */ + public RouteInner withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withCacheConfiguration(cacheConfiguration); + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().forwardingProtocol(); + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteInner object itself. + */ + public RouteInner withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withForwardingProtocol(forwardingProtocol); + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().linkToDefaultDomain(); + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteInner object itself. + */ + public RouteInner withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.innerProperties() == null ? null : this.innerProperties().httpsRedirect(); + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteInner object itself. + */ + public RouteInner withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withHttpsRedirect(httpsRedirect); + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteInner object itself. + */ + public RouteInner withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteProperties(); + } + this.innerProperties().withEnabledState(enabledState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.java new file mode 100644 index 0000000000000..6535e2bba0f9c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the Routes to create. */ +@Fluent +public final class RouteProperties extends RouteUpdatePropertiesParameters { + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of RouteProperties class. */ + public RouteProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withCustomDomains(List customDomains) { + super.withCustomDomains(customDomains); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withOriginGroup(ResourceReference originGroup) { + super.withOriginGroup(originGroup); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withOriginPath(String originPath) { + super.withOriginPath(originPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withRuleSets(List ruleSets) { + super.withRuleSets(ruleSets); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withSupportedProtocols(List supportedProtocols) { + super.withSupportedProtocols(supportedProtocols); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withPatternsToMatch(List patternsToMatch) { + super.withPatternsToMatch(patternsToMatch); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + super.withCacheConfiguration(cacheConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + super.withForwardingProtocol(forwardingProtocol); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + super.withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withHttpsRedirect(HttpsRedirect httpsRedirect) { + super.withHttpsRedirect(httpsRedirect); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withEnabledState(EnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..60345e2994368 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteUpdatePropertiesParameters.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public class RouteUpdatePropertiesParameters { + /* + * The name of the endpoint which holds the route. + */ + @JsonProperty(value = "endpointName", access = JsonProperty.Access.WRITE_ONLY) + private String endpointName; + + /* + * Domains referenced by this endpoint. + */ + @JsonProperty(value = "customDomains") + private List customDomains; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "originGroup") + private ResourceReference originGroup; + + /* + * A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "originPath") + private String originPath; + + /* + * rule sets referenced by this endpoint. + */ + @JsonProperty(value = "ruleSets") + private List ruleSets; + + /* + * List of supported protocols for this route. + */ + @JsonProperty(value = "supportedProtocols") + private List supportedProtocols; + + /* + * The route patterns of the rule. + */ + @JsonProperty(value = "patternsToMatch") + private List patternsToMatch; + + /* + * The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object. + */ + @JsonProperty(value = "cacheConfiguration") + private AfdRouteCacheConfiguration cacheConfiguration; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + @JsonProperty(value = "forwardingProtocol") + private ForwardingProtocol forwardingProtocol; + + /* + * whether this route will be linked to the default endpoint domain. + */ + @JsonProperty(value = "linkToDefaultDomain") + private LinkToDefaultDomain linkToDefaultDomain; + + /* + * Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this + * rule and it will be the first rule that gets executed. + */ + @JsonProperty(value = "httpsRedirect") + private HttpsRedirect httpsRedirect; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "enabledState") + private EnabledState enabledState; + + /** Creates an instance of RouteUpdatePropertiesParameters class. */ + public RouteUpdatePropertiesParameters() { + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.originGroup; + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withOriginGroup(ResourceReference originGroup) { + this.originGroup = originGroup; + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.originPath; + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.ruleSets; + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withRuleSets(List ruleSets) { + this.ruleSets = ruleSets; + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.supportedProtocols; + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withSupportedProtocols(List supportedProtocols) { + this.supportedProtocols = supportedProtocols; + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.patternsToMatch; + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.cacheConfiguration; + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + this.cacheConfiguration = cacheConfiguration; + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.forwardingProtocol; + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + this.forwardingProtocol = forwardingProtocol; + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.linkToDefaultDomain; + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + this.linkToDefaultDomain = linkToDefaultDomain; + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.httpsRedirect; + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withHttpsRedirect(HttpsRedirect httpsRedirect) { + this.httpsRedirect = httpsRedirect; + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + if (originGroup() != null) { + originGroup().validate(); + } + if (ruleSets() != null) { + ruleSets().forEach(e -> e.validate()); + } + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.java new file mode 100644 index 0000000000000..9a410d243492f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Friendly Rules name mapping to the any Rules or secret related information. */ +@Fluent +public final class RuleInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Rules to create. + */ + @JsonProperty(value = "properties") + private RuleProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RuleInner class. */ + public RuleInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Rules to create. + * + * @return the innerProperties value. + */ + private RuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetName(); + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public Integer order() { + return this.innerProperties() == null ? null : this.innerProperties().order(); + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the RuleInner object itself. + */ + public RuleInner withOrder(Integer order) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withOrder(order); + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the RuleInner object itself. + */ + public RuleInner withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the RuleInner object itself. + */ + public RuleInner withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().matchProcessingBehavior(); + } + + /** + * Set the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @param matchProcessingBehavior the matchProcessingBehavior value to set. + * @return the RuleInner object itself. + */ + public RuleInner withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleProperties(); + } + this.innerProperties().withMatchProcessingBehavior(matchProcessingBehavior); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.java new file mode 100644 index 0000000000000..7489a3dac099b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the Rules to create. */ +@Fluent +public final class RuleProperties extends RuleUpdatePropertiesParameters { + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of RuleProperties class. */ + public RuleProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** {@inheritDoc} */ + @Override + public RuleProperties withOrder(Integer order) { + super.withOrder(order); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleProperties withConditions(List conditions) { + super.withConditions(conditions); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleProperties withActions(List actions) { + super.withActions(actions); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleProperties withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + super.withMatchProcessingBehavior(matchProcessingBehavior); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java new file mode 100644 index 0000000000000..d6e6f05506a5b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Friendly RuleSet name mapping to the any RuleSet or secret related information. */ +@Immutable +public final class RuleSetInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Rule Set to create. + */ + @JsonProperty(value = "properties") + private RuleSetProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RuleSetInner class. */ + public RuleSetInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Rule Set to create. + * + * @return the innerProperties value. + */ + private RuleSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.java new file mode 100644 index 0000000000000..074e29996bd59 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetProperties.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the Rule Set to create. */ +@Immutable +public final class RuleSetProperties extends AfdStateProperties { + /* + * The name of the profile which holds the rule set. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /** Creates an instance of RuleSetProperties class. */ + public RuleSetProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..6ce0b205ae5cd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleUpdatePropertiesParameters.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the rule to update. */ +@Fluent +public class RuleUpdatePropertiesParameters { + /* + * The name of the rule set containing the rule. + */ + @JsonProperty(value = "ruleSetName", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetName; + + /* + * The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser + * order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not + * require any condition and actions listed in it will always be applied. + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule are satisfied. + */ + @JsonProperty(value = "actions") + private List actions; + + /* + * If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, + * defaults to Continue. + */ + @JsonProperty(value = "matchProcessingBehavior") + private MatchProcessingBehavior matchProcessingBehavior; + + /** Creates an instance of RuleUpdatePropertiesParameters class. */ + public RuleUpdatePropertiesParameters() { + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.ruleSetName; + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the RuleUpdatePropertiesParameters object itself. + */ + public RuleUpdatePropertiesParameters withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the RuleUpdatePropertiesParameters object itself. + */ + public RuleUpdatePropertiesParameters withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the RuleUpdatePropertiesParameters object itself. + */ + public RuleUpdatePropertiesParameters withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + public MatchProcessingBehavior matchProcessingBehavior() { + return this.matchProcessingBehavior; + } + + /** + * Set the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @param matchProcessingBehavior the matchProcessingBehavior value to set. + * @return the RuleUpdatePropertiesParameters object itself. + */ + public RuleUpdatePropertiesParameters withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + this.matchProcessingBehavior = matchProcessingBehavior; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actions() != null) { + actions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.java new file mode 100644 index 0000000000000..ea867e5751f47 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.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.cdn.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.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Friendly Secret name mapping to the any Secret or secret related information. */ +@Fluent +public final class SecretInner extends ProxyResource { + /* + * The JSON object that contains the properties of the Secret to create. + */ + @JsonProperty(value = "properties") + private SecretProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SecretInner class. */ + public SecretInner() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the Secret to create. + * + * @return the innerProperties value. + */ + private SecretProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + public SecretParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains secret parameters. + * + * @param parameters the parameters value to set. + * @return the SecretInner object itself. + */ + public SecretInner withParameters(SecretParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecretProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.java new file mode 100644 index 0000000000000..d36a983de3d01 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the Secret to create. */ +@Fluent +public final class SecretProperties extends AfdStateProperties { + /* + * The name of the profile which holds the secret. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /* + * object which contains secret parameters + */ + @JsonProperty(value = "parameters") + private SecretParameters parameters; + + /** Creates an instance of SecretProperties class. */ + public SecretProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + public SecretParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains secret parameters. + * + * @param parameters the parameters value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withParameters(SecretParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() != null) { + parameters().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.java new file mode 100644 index 0000000000000..0e7b72d2303e5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.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.cdn.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.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SecurityPolicy association for AzureFrontDoor profile. */ +@Fluent +public final class SecurityPolicyInner extends ProxyResource { + /* + * The json object that contains properties required to create a security policy + */ + @JsonProperty(value = "properties") + private SecurityPolicyProperties innerProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SecurityPolicyInner class. */ + public SecurityPolicyInner() { + } + + /** + * Get the innerProperties property: The json object that contains properties required to create a security policy. + * + * @return the innerProperties value. + */ + private SecurityPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyInner object itself. + */ + public SecurityPolicyInner withParameters(SecurityPolicyPropertiesParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPolicyProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.java new file mode 100644 index 0000000000000..f0ecf192ce96f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.AfdStateProperties; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The json object that contains properties required to create a security policy. */ +@Fluent +public final class SecurityPolicyProperties extends AfdStateProperties { + /* + * The name of the profile which holds the security policy. + */ + @JsonProperty(value = "profileName", access = JsonProperty.Access.WRITE_ONLY) + private String profileName; + + /* + * object which contains security policy parameters + */ + @JsonProperty(value = "parameters") + private SecurityPolicyPropertiesParameters parameters; + + /** Creates an instance of SecurityPolicyProperties class. */ + public SecurityPolicyProperties() { + } + + /** + * Get the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyProperties object itself. + */ + public SecurityPolicyProperties withParameters(SecurityPolicyPropertiesParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() != null) { + parameters().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.java new file mode 100644 index 0000000000000..9241e083f201f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyUpdateProperties.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The json object that contains properties required to update a security policy. */ +@Fluent +public final class SecurityPolicyUpdateProperties { + /* + * object which contains security policy parameters + */ + @JsonProperty(value = "parameters") + private SecurityPolicyPropertiesParameters parameters; + + /** Creates an instance of SecurityPolicyUpdateProperties class. */ + public SecurityPolicyUpdateProperties() { + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyUpdateProperties object itself. + */ + public SecurityPolicyUpdateProperties withParameters(SecurityPolicyPropertiesParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SsoUriInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SsoUriInner.java new file mode 100644 index 0000000000000..b6a104641991b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SsoUriInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The URI required to login to the supplemental portal from the Azure portal. */ +@Immutable +public final class SsoUriInner { + /* + * The URI used to login to the supplemental portal. + */ + @JsonProperty(value = "ssoUriValue", access = JsonProperty.Access.WRITE_ONLY) + private String ssoUriValue; + + /** Creates an instance of SsoUriInner class. */ + public SsoUriInner() { + } + + /** + * Get the ssoUriValue property: The URI used to login to the supplemental portal. + * + * @return the ssoUriValue value. + */ + public String ssoUriValue() { + return this.ssoUriValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SupportedOptimizationTypesListResultInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SupportedOptimizationTypesListResultInner.java new file mode 100644 index 0000000000000..100d0778c5eed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SupportedOptimizationTypesListResultInner.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.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the GetSupportedOptimizationTypes API. */ +@Immutable +public final class SupportedOptimizationTypesListResultInner { + /* + * Supported optimization types for a profile. + */ + @JsonProperty(value = "supportedOptimizationTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedOptimizationTypes; + + /** Creates an instance of SupportedOptimizationTypesListResultInner class. */ + public SupportedOptimizationTypesListResultInner() { + } + + /** + * Get the supportedOptimizationTypes property: Supported optimization types for a profile. + * + * @return the supportedOptimizationTypes value. + */ + public List supportedOptimizationTypes() { + return this.supportedOptimizationTypes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..e8b3c642ce417 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.UsageName; +import com.azure.resourcemanager.cdn.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes resource usage. */ +@Fluent +public final class UsageInner { + /* + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private UsageUnit unit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /* + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** Creates an instance of UsageInner class. */ + public UsageInner() { + } + + /** + * Get the id property: Resource identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: An enum describing the unit of measurement. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the usage. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The limit of usage. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit of usage. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name of the type of usage. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (unit() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateCustomDomainOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateCustomDomainOutputInner.java new file mode 100644 index 0000000000000..dd8ac0dee5a3d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateCustomDomainOutputInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of custom domain validation. */ +@Immutable +public final class ValidateCustomDomainOutputInner { + /* + * Indicates whether the custom domain is valid or not. + */ + @JsonProperty(value = "customDomainValidated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean customDomainValidated; + + /* + * The reason why the custom domain is not valid. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * Error message describing why the custom domain is not valid. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of ValidateCustomDomainOutputInner class. */ + public ValidateCustomDomainOutputInner() { + } + + /** + * Get the customDomainValidated property: Indicates whether the custom domain is valid or not. + * + * @return the customDomainValidated value. + */ + public Boolean customDomainValidated() { + return this.customDomainValidated; + } + + /** + * Get the reason property: The reason why the custom domain is not valid. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: Error message describing why the custom domain is not valid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateProbeOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateProbeOutputInner.java new file mode 100644 index 0000000000000..dc5cb8cdd9212 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateProbeOutputInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of the validate probe API. */ +@Immutable +public final class ValidateProbeOutputInner { + /* + * Indicates whether the probe URL is accepted or not. + */ + @JsonProperty(value = "isValid", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isValid; + + /* + * Specifies the error code when the probe url is not accepted. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The detailed error message describing why the probe URL is not accepted. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of ValidateProbeOutputInner class. */ + public ValidateProbeOutputInner() { + } + + /** + * Get the isValid property: Indicates whether the probe URL is accepted or not. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Get the errorCode property: Specifies the error code when the probe url is not accepted. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the message property: The detailed error message describing why the probe URL is not accepted. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateSecretOutputInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateSecretOutputInner.java new file mode 100644 index 0000000000000..f97af47215592 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateSecretOutputInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of the validated secret. */ +@Fluent +public final class ValidateSecretOutputInner { + /* + * The validation status. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Detailed error message + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of ValidateSecretOutputInner class. */ + public ValidateSecretOutputInner() { + } + + /** + * Get the status property: The validation status. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The validation status. + * + * @param status the status value to set. + * @return the ValidateSecretOutputInner object itself. + */ + public ValidateSecretOutputInner withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the message property: Detailed error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Detailed error message. + * + * @param message the message value to set. + * @return the ValidateSecretOutputInner object itself. + */ + public ValidateSecretOutputInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafMetricsResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafMetricsResponseInner.java new file mode 100644 index 0000000000000..b6efb1515753d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafMetricsResponseInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseSeriesItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Waf Metrics Response. */ +@Fluent +public final class WafMetricsResponseInner { + /* + * The dateTimeBegin property. + */ + @JsonProperty(value = "dateTimeBegin") + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + @JsonProperty(value = "dateTimeEnd") + private OffsetDateTime dateTimeEnd; + + /* + * The granularity property. + */ + @JsonProperty(value = "granularity") + private WafMetricsGranularity granularity; + + /* + * The series property. + */ + @JsonProperty(value = "series") + private List series; + + /** Creates an instance of WafMetricsResponseInner class. */ + public WafMetricsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the granularity property: The granularity property. + * + * @return the granularity value. + */ + public WafMetricsGranularity granularity() { + return this.granularity; + } + + /** + * Set the granularity property: The granularity property. + * + * @param granularity the granularity value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withGranularity(WafMetricsGranularity granularity) { + this.granularity = granularity; + return this; + } + + /** + * Get the series property: The series property. + * + * @return the series value. + */ + public List series() { + return this.series; + } + + /** + * Set the series property: The series property. + * + * @param series the series value to set. + * @return the WafMetricsResponseInner object itself. + */ + public WafMetricsResponseInner withSeries(List series) { + this.series = series; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (series() != null) { + series().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafRankingsResponseInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafRankingsResponseInner.java new file mode 100644 index 0000000000000..33834401afcf1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafRankingsResponseInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponseDataItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Waf Rankings Response. */ +@Fluent +public final class WafRankingsResponseInner { + /* + * The dateTimeBegin property. + */ + @JsonProperty(value = "dateTimeBegin") + private OffsetDateTime dateTimeBegin; + + /* + * The dateTimeEnd property. + */ + @JsonProperty(value = "dateTimeEnd") + private OffsetDateTime dateTimeEnd; + + /* + * The groups property. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** Creates an instance of WafRankingsResponseInner class. */ + public WafRankingsResponseInner() { + } + + /** + * Get the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + public OffsetDateTime dateTimeBegin() { + return this.dateTimeBegin; + } + + /** + * Set the dateTimeBegin property: The dateTimeBegin property. + * + * @param dateTimeBegin the dateTimeBegin value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withDateTimeBegin(OffsetDateTime dateTimeBegin) { + this.dateTimeBegin = dateTimeBegin; + return this; + } + + /** + * Get the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + public OffsetDateTime dateTimeEnd() { + return this.dateTimeEnd; + } + + /** + * Set the dateTimeEnd property: The dateTimeEnd property. + * + * @param dateTimeEnd the dateTimeEnd value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withDateTimeEnd(OffsetDateTime dateTimeEnd) { + this.dateTimeEnd = dateTimeEnd; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the WafRankingsResponseInner object itself. + */ + public WafRankingsResponseInner withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (data() != null) { + data().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..a54758f59c9dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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 CdnManagementClient. Cdn Management Client. */ +package com.azure.resourcemanager.cdn.generated.fluent.models; diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/package-info.java new file mode 100644 index 0000000000000..3df21dcdc2523 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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 CdnManagementClient. Cdn Management Client. */ +package com.azure.resourcemanager.cdn.generated.fluent; diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java new file mode 100644 index 0000000000000..09992fe789818 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java @@ -0,0 +1,1834 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; +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 AfdCustomDomainsClient. */ +public final class AfdCustomDomainsClientImpl implements AfdCustomDomainsClient { + /** The proxy service used to perform REST calls. */ + private final AfdCustomDomainsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdCustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdCustomDomainsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(AfdCustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdCustomDomains to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + private interface AfdCustomDomainsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdDomainInner customDomain, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdDomainUpdateParameters customDomainUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains/{customDomainName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/customDomains/{customDomainName}/refreshValidationToken") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshValidationToken( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner get(String resourceGroupName, String profileName, String customDomainName) { + return getWithResponse(resourceGroupName, profileName, customDomainName, Context.NONE).getValue(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomain == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomain is required and cannot be null.")); + } else { + customDomain.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomain, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomain == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomain is required and cannot be null.")); + } else { + customDomain.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomain, + accept, + context); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginCreateAsync( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomain); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdDomainInner.class, + AfdDomainInner.class, + this.client.getContext()); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomain, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdDomainInner.class, AfdDomainInner.class, context); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginCreate( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain).getSyncPoller(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain, context) + .getSyncPoller(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, customDomainName, customDomain, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner create( + String resourceGroupName, String profileName, String customDomainName, AfdDomainInner customDomain) { + return createAsync(resourceGroupName, profileName, customDomainName, customDomain).block(); + } + + /** + * Creates a new domain within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomain Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner create( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainInner customDomain, + Context context) { + return createAsync(resourceGroupName, profileName, customDomainName, customDomain, context).block(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customDomainUpdateProperties is required and cannot be null.")); + } else { + customDomainUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customDomainUpdateProperties is required and cannot be null.")); + } else { + customDomainUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainUpdateProperties, + accept, + context); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdDomainInner.class, + AfdDomainInner.class, + this.client.getContext()); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdDomainInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdDomainInner.class, AfdDomainInner.class, context); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginUpdate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdDomainInner> beginUpdate( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner update( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties) { + return updateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties).block(); + } + + /** + * Updates an existing domain within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param customDomainUpdateProperties Domain properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdDomainInner update( + String resourceGroupName, + String profileName, + String customDomainName, + AfdDomainUpdateParameters customDomainUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, customDomainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, customDomainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String customDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String customDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, customDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String customDomainName) { + deleteAsync(resourceGroupName, profileName, customDomainName).block(); + } + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String customDomainName, Context context) { + deleteAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshValidationTokenWithResponseAsync( + String resourceGroupName, String profileName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 + .refreshValidationToken( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshValidationTokenWithResponseAsync( + String resourceGroupName, String profileName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 + .refreshValidationToken( + this.client.getEndpoint(), + resourceGroupName, + profileName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshValidationTokenAsync( + String resourceGroupName, String profileName, String customDomainName) { + Mono>> mono = + refreshValidationTokenWithResponseAsync(resourceGroupName, profileName, customDomainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshValidationTokenAsync( + String resourceGroupName, String profileName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshValidationTokenWithResponseAsync(resourceGroupName, profileName, customDomainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshValidationToken( + String resourceGroupName, String profileName, String customDomainName) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName).getSyncPoller(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 refreshValidationTokenAsync( + String resourceGroupName, String profileName, String customDomainName) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 refreshValidationTokenAsync( + String resourceGroupName, String profileName, String customDomainName, Context context) { + return beginRefreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refreshValidationToken(String resourceGroupName, String profileName, String customDomainName) { + refreshValidationTokenAsync(resourceGroupName, profileName, customDomainName).block(); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context) { + refreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * 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 result of the request to list domains along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list domains along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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 + .listByProfileNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java new file mode 100644 index 0000000000000..305b59c6dc879 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdCustomDomains; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; + +public final class AfdCustomDomainsImpl implements AfdCustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(AfdCustomDomainsImpl.class); + + private final AfdCustomDomainsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdCustomDomainsImpl( + AfdCustomDomainsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, customDomainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AfdDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdDomain get(String resourceGroupName, String profileName, String customDomainName) { + AfdDomainInner inner = this.serviceClient().get(resourceGroupName, profileName, customDomainName); + if (inner != null) { + return new AfdDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String customDomainName) { + this.serviceClient().delete(resourceGroupName, profileName, customDomainName); + } + + public void delete(String resourceGroupName, String profileName, String customDomainName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, customDomainName, context); + } + + public void refreshValidationToken(String resourceGroupName, String profileName, String customDomainName) { + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName); + } + + public void refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context) { + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + } + + public AfdDomain 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, customDomainName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, customDomainName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + this.delete(resourceGroupName, profileName, customDomainName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + this.delete(resourceGroupName, profileName, customDomainName, context); + } + + private AfdCustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdDomainImpl define(String name) { + return new AfdDomainImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java new file mode 100644 index 0000000000000..1c3e0f7e99621 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationProperties; +import com.azure.resourcemanager.cdn.generated.models.DomainValidationState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Collections; +import java.util.Map; + +public final class AfdDomainImpl implements AfdDomain, AfdDomain.Definition, AfdDomain.Update { + private AfdDomainInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DomainValidationState domainValidationState() { + return this.innerModel().domainValidationState(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DomainValidationProperties validationProperties() { + return this.innerModel().validationProperties(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public AfdDomainHttpsParameters tlsSettings() { + return this.innerModel().tlsSettings(); + } + + public ResourceReference azureDnsZone() { + return this.innerModel().azureDnsZone(); + } + + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerModel().preValidatedCustomDomainResourceId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String customDomainName; + + private AfdDomainUpdateParameters updateCustomDomainUpdateProperties; + + public AfdDomainImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdDomain create() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .create(resourceGroupName, profileName, customDomainName, this.innerModel(), Context.NONE); + return this; + } + + public AfdDomain create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .create(resourceGroupName, profileName, customDomainName, this.innerModel(), context); + return this; + } + + AfdDomainImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdDomainInner(); + this.serviceManager = serviceManager; + this.customDomainName = name; + } + + public AfdDomainImpl update() { + this.updateCustomDomainUpdateProperties = new AfdDomainUpdateParameters(); + return this; + } + + public AfdDomain apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .update( + resourceGroupName, profileName, customDomainName, updateCustomDomainUpdateProperties, Context.NONE); + return this; + } + + public AfdDomain apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .update(resourceGroupName, profileName, customDomainName, updateCustomDomainUpdateProperties, context); + return this; + } + + AfdDomainImpl(AfdDomainInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.customDomainName = Utils.getValueFromIdByName(innerObject.id(), "customDomains"); + } + + public AfdDomain refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .getWithResponse(resourceGroupName, profileName, customDomainName, Context.NONE) + .getValue(); + return this; + } + + public AfdDomain refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdCustomDomains() + .getWithResponse(resourceGroupName, profileName, customDomainName, context) + .getValue(); + return this; + } + + public void refreshValidationToken() { + serviceManager.afdCustomDomains().refreshValidationToken(resourceGroupName, profileName, customDomainName); + } + + public void refreshValidationToken(Context context) { + serviceManager + .afdCustomDomains() + .refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + } + + public AfdDomainImpl withHostname(String hostname) { + this.innerModel().withHostname(hostname); + return this; + } + + public AfdDomainImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + public AfdDomainImpl withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (isInCreateMode()) { + this.innerModel().withTlsSettings(tlsSettings); + return this; + } else { + this.updateCustomDomainUpdateProperties.withTlsSettings(tlsSettings); + return this; + } + } + + public AfdDomainImpl withAzureDnsZone(ResourceReference azureDnsZone) { + if (isInCreateMode()) { + this.innerModel().withAzureDnsZone(azureDnsZone); + return this; + } else { + this.updateCustomDomainUpdateProperties.withAzureDnsZone(azureDnsZone); + return this; + } + } + + public AfdDomainImpl withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId) { + if (isInCreateMode()) { + this.innerModel().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } else { + this + .updateCustomDomainUpdateProperties + .withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java new file mode 100644 index 0000000000000..d7d1c40511333 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; +import java.util.Collections; +import java.util.Map; + +public final class AfdEndpointImpl implements AfdEndpoint, AfdEndpoint.Definition, AfdEndpoint.Update { + private AfdEndpointInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.innerModel().autoGeneratedDomainNameLabelScope(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private AfdEndpointUpdateParameters updateEndpointUpdateProperties; + + public AfdEndpointImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), Context.NONE); + return this; + } + + public AfdEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), context); + return this; + } + + AfdEndpointImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdEndpointInner(); + this.serviceManager = serviceManager; + this.endpointName = name; + } + + public AfdEndpointImpl update() { + this.updateEndpointUpdateProperties = new AfdEndpointUpdateParameters(); + return this; + } + + public AfdEndpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, Context.NONE); + return this; + } + + public AfdEndpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, context); + return this; + } + + AfdEndpointImpl(AfdEndpointInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "afdEndpoints"); + } + + public AfdEndpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE) + .getValue(); + return this; + } + + public AfdEndpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, context) + .getValue(); + return this; + } + + public void purgeContent(AfdPurgeParameters contents) { + serviceManager.afdEndpoints().purgeContent(resourceGroupName, profileName, endpointName, contents); + } + + public void purgeContent(AfdPurgeParameters contents, Context context) { + serviceManager.afdEndpoints().purgeContent(resourceGroupName, profileName, endpointName, contents, context); + } + + public PagedIterable listResourceUsage() { + return serviceManager.afdEndpoints().listResourceUsage(resourceGroupName, profileName, endpointName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.afdEndpoints().listResourceUsage(resourceGroupName, profileName, endpointName, context); + } + + public Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager + .afdEndpoints() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + } + + public ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager + .afdEndpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public AfdEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AfdEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AfdEndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEndpointUpdateProperties.withTags(tags); + return this; + } + } + + public AfdEndpointImpl withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.innerModel().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope); + return this; + } + + public AfdEndpointImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateEndpointUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java new file mode 100644 index 0000000000000..30ed545f58c47 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java @@ -0,0 +1,2460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +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 AfdEndpointsClient. */ +public final class AfdEndpointsClientImpl implements AfdEndpointsClient { + /** The proxy service used to perform REST calls. */ + private final AfdEndpointsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdEndpointsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(AfdEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + private interface AfdEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdEndpointInner endpointParam, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdEndpointUpdateParameters endpointUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/purge") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeContent( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdPurgeParameters contents, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateCustomDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateCustomDomainInput customDomainProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @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> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile( + String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner get(String resourceGroupName, String profileName, String endpointName) { + return getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE).getValue(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointParam, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointParam, + accept, + context); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdEndpointInner.class, + AfdEndpointInner.class, + this.client.getContext()); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdEndpointInner.class, AfdEndpointInner.class, context); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).getSyncPoller(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context).getSyncPoller(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpointParam) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam).block(); + } + + /** + * Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner create( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointInner endpointParam, + Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam, context).block(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointUpdateProperties, + accept, + context); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdEndpointInner.class, + AfdEndpointInner.class, + this.client.getContext()); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdEndpointInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdEndpointInner.class, AfdEndpointInner.class, context); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).getSyncPoller(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door endpoint is the entity within a Azure Front Door + * profile containing configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdEndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).block(); + } + + /** + * Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the + * Update Origin operation. To update origin groups, use the Update Origin group operation. To update domains, use + * the Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration + * information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdEndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + AfdEndpointUpdateParameters endpointUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).block(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, endpointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName) { + deleteAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeContentWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contents == null) { + return Mono.error(new IllegalArgumentException("Parameter contents is required and cannot be null.")); + } else { + contents.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purgeContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contents, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeContentWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contents == null) { + return Mono.error(new IllegalArgumentException("Parameter contents is required and cannot be null.")); + } else { + contents.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purgeContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contents, + accept, + context); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContentAsync( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContent( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents).getSyncPoller(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents, context).getSyncPoller(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeContentAsync( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contents, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purgeContent( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contents).block(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contents, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateCustomDomain( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateCustomDomain( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties, context) + .block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateCustomDomainOutputInner validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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 + .listByProfileNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java new file mode 100644 index 0000000000000..f6660271a3902 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoints; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class AfdEndpointsImpl implements AfdEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(AfdEndpointsImpl.class); + + private final AfdEndpointsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdEndpointsImpl( + AfdEndpointsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AfdEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdEndpoint get(String resourceGroupName, String profileName, String endpointName) { + AfdEndpointInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new AfdEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, context); + } + + public void purgeContent( + String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contents); + } + + public void purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contents, context); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + Response inner = + this + .serviceClient() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateCustomDomainOutput validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + ValidateCustomDomainOutputInner inner = + this + .serviceClient() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public AfdEndpoint 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, context); + } + + private AfdEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdEndpointImpl define(String name) { + return new AfdEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java new file mode 100644 index 0000000000000..afbc9ca5e436e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class AfdOriginGroupImpl implements AfdOriginGroup, AfdOriginGroup.Definition, AfdOriginGroup.Update { + private AfdOriginGroupInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerModel().loadBalancingSettings(); + } + + public HealthProbeParameters healthProbeSettings() { + return this.innerModel().healthProbeSettings(); + } + + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerModel().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + public EnabledState sessionAffinityState() { + return this.innerModel().sessionAffinityState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdOriginGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String originGroupName; + + private AfdOriginGroupUpdateParameters updateOriginGroupUpdateProperties; + + public AfdOriginGroupImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public AfdOriginGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .create(resourceGroupName, profileName, originGroupName, this.innerModel(), Context.NONE); + return this; + } + + public AfdOriginGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .create(resourceGroupName, profileName, originGroupName, this.innerModel(), context); + return this; + } + + AfdOriginGroupImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdOriginGroupInner(); + this.serviceManager = serviceManager; + this.originGroupName = name; + } + + public AfdOriginGroupImpl update() { + this.updateOriginGroupUpdateProperties = new AfdOriginGroupUpdateParameters(); + return this; + } + + public AfdOriginGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .update( + resourceGroupName, profileName, originGroupName, updateOriginGroupUpdateProperties, Context.NONE); + return this; + } + + public AfdOriginGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .update(resourceGroupName, profileName, originGroupName, updateOriginGroupUpdateProperties, context); + return this; + } + + AfdOriginGroupImpl( + AfdOriginGroupInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.originGroupName = Utils.getValueFromIdByName(innerObject.id(), "originGroups"); + } + + public AfdOriginGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .getWithResponse(resourceGroupName, profileName, originGroupName, Context.NONE) + .getValue(); + return this; + } + + public AfdOriginGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOriginGroups() + .getWithResponse(resourceGroupName, profileName, originGroupName, context) + .getValue(); + return this; + } + + public PagedIterable listResourceUsage() { + return serviceManager.afdOriginGroups().listResourceUsage(resourceGroupName, profileName, originGroupName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager + .afdOriginGroups() + .listResourceUsage(resourceGroupName, profileName, originGroupName, context); + } + + public AfdOriginGroupImpl withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings) { + if (isInCreateMode()) { + this.innerModel().withLoadBalancingSettings(loadBalancingSettings); + return this; + } else { + this.updateOriginGroupUpdateProperties.withLoadBalancingSettings(loadBalancingSettings); + return this; + } + } + + public AfdOriginGroupImpl withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (isInCreateMode()) { + this.innerModel().withHealthProbeSettings(healthProbeSettings); + return this; + } else { + this.updateOriginGroupUpdateProperties.withHealthProbeSettings(healthProbeSettings); + return this; + } + } + + public AfdOriginGroupImpl withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (isInCreateMode()) { + this + .innerModel() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } else { + this + .updateOriginGroupUpdateProperties + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + } + + public AfdOriginGroupImpl withSessionAffinityState(EnabledState sessionAffinityState) { + if (isInCreateMode()) { + this.innerModel().withSessionAffinityState(sessionAffinityState); + return this; + } else { + this.updateOriginGroupUpdateProperties.withSessionAffinityState(sessionAffinityState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java new file mode 100644 index 0000000000000..30f072baa8194 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java @@ -0,0 +1,1842 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +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 AfdOriginGroupsClient. */ +public final class AfdOriginGroupsClientImpl implements AfdOriginGroupsClient { + /** The proxy service used to perform REST calls. */ + private final AfdOriginGroupsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdOriginGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdOriginGroupsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(AfdOriginGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdOriginGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + private interface AfdOriginGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginGroupInner originGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginGroupUpdateParameters originGroupUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @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> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile( + String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, context).block(); + } + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner get(String resourceGroupName, String profileName, String originGroupName) { + return getWithResponse(resourceGroupName, profileName, originGroupName, Context.NONE).getValue(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroup, + accept, + context); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginCreateAsync( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdOriginGroupInner.class, + AfdOriginGroupInner.class, + this.client.getContext()); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroup, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdOriginGroupInner.class, AfdOriginGroupInner.class, context); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginCreate( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup).getSyncPoller(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup, context).getSyncPoller(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner create( + String resourceGroupName, String profileName, String originGroupName, AfdOriginGroupInner originGroup) { + return createAsync(resourceGroupName, profileName, originGroupName, originGroup).block(); + } + + /** + * Creates a new origin group within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner create( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupInner originGroup, + Context context) { + return createAsync(resourceGroupName, profileName, originGroupName, originGroup, context).block(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroupUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroupUpdateProperties, + accept, + context); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdOriginGroupInner.class, + AfdOriginGroupInner.class, + this.client.getContext()); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginGroupInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdOriginGroupInner.class, AfdOriginGroupInner.class, context); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aFDOrigin group comprising of origins is used for load balancing to + * origins when the content cannot be served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner update( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties) { + return updateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties).block(); + } + + /** + * Updates an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be + * served from Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginGroupInner update( + String resourceGroupName, + String profileName, + String originGroupName, + AfdOriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, originGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName).getSyncPoller(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String originGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String originGroupName) { + deleteAsync(resourceGroupName, profileName, originGroupName).block(); + } + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String originGroupName, Context context) { + deleteAsync(resourceGroupName, profileName, originGroupName, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String originGroupName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, originGroupName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, originGroupName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, originGroupName, 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 result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync( + 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 + .listByProfileNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java new file mode 100644 index 0000000000000..7d38c69b5021b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.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.cdn.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.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroups; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class AfdOriginGroupsImpl implements AfdOriginGroups { + private static final ClientLogger LOGGER = new ClientLogger(AfdOriginGroupsImpl.class); + + private final AfdOriginGroupsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdOriginGroupsImpl( + AfdOriginGroupsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, originGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AfdOriginGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdOriginGroup get(String resourceGroupName, String profileName, String originGroupName) { + AfdOriginGroupInner inner = this.serviceClient().get(resourceGroupName, profileName, originGroupName); + if (inner != null) { + return new AfdOriginGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String originGroupName) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName); + } + + public void delete(String resourceGroupName, String profileName, String originGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, context); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, originGroupName); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, originGroupName, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public AfdOriginGroup 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, originGroupName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, originGroupName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, context); + } + + private AfdOriginGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdOriginGroupImpl define(String name) { + return new AfdOriginGroupImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java new file mode 100644 index 0000000000000..95963f358d5fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SharedPrivateLinkResourceProperties; + +public final class AfdOriginImpl implements AfdOrigin, AfdOrigin.Definition, AfdOrigin.Update { + private AfdOriginInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String originGroupName() { + return this.innerModel().originGroupName(); + } + + public ResourceReference azureOrigin() { + return this.innerModel().azureOrigin(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer httpPort() { + return this.innerModel().httpPort(); + } + + public Integer httpsPort() { + return this.innerModel().httpsPort(); + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public Integer weight() { + return this.innerModel().weight(); + } + + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerModel().sharedPrivateLinkResource(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public Boolean enforceCertificateNameCheck() { + return this.innerModel().enforceCertificateNameCheck(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AfdOriginInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String originGroupName; + + private String originName; + + private AfdOriginUpdateParameters updateOriginUpdateProperties; + + public AfdOriginImpl withExistingOriginGroup(String resourceGroupName, String profileName, String originGroupName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.originGroupName = originGroupName; + return this; + } + + public AfdOrigin create() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .create(resourceGroupName, profileName, originGroupName, originName, this.innerModel(), Context.NONE); + return this; + } + + public AfdOrigin create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .create(resourceGroupName, profileName, originGroupName, originName, this.innerModel(), context); + return this; + } + + AfdOriginImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new AfdOriginInner(); + this.serviceManager = serviceManager; + this.originName = name; + } + + public AfdOriginImpl update() { + this.updateOriginUpdateProperties = new AfdOriginUpdateParameters(); + return this; + } + + public AfdOrigin apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .update( + resourceGroupName, + profileName, + originGroupName, + originName, + updateOriginUpdateProperties, + Context.NONE); + return this; + } + + public AfdOrigin apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .update( + resourceGroupName, profileName, originGroupName, originName, updateOriginUpdateProperties, context); + return this; + } + + AfdOriginImpl(AfdOriginInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.originGroupName = Utils.getValueFromIdByName(innerObject.id(), "originGroups"); + this.originName = Utils.getValueFromIdByName(innerObject.id(), "origins"); + } + + public AfdOrigin refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, Context.NONE) + .getValue(); + return this; + } + + public AfdOrigin refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAfdOrigins() + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, context) + .getValue(); + return this; + } + + public AfdOriginImpl withAzureOrigin(ResourceReference azureOrigin) { + if (isInCreateMode()) { + this.innerModel().withAzureOrigin(azureOrigin); + return this; + } else { + this.updateOriginUpdateProperties.withAzureOrigin(azureOrigin); + return this; + } + } + + public AfdOriginImpl withHostname(String hostname) { + if (isInCreateMode()) { + this.innerModel().withHostname(hostname); + return this; + } else { + this.updateOriginUpdateProperties.withHostname(hostname); + return this; + } + } + + public AfdOriginImpl withHttpPort(Integer httpPort) { + if (isInCreateMode()) { + this.innerModel().withHttpPort(httpPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpPort(httpPort); + return this; + } + } + + public AfdOriginImpl withHttpsPort(Integer httpsPort) { + if (isInCreateMode()) { + this.innerModel().withHttpsPort(httpsPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpsPort(httpsPort); + return this; + } + } + + public AfdOriginImpl withOriginHostHeader(String originHostHeader) { + if (isInCreateMode()) { + this.innerModel().withOriginHostHeader(originHostHeader); + return this; + } else { + this.updateOriginUpdateProperties.withOriginHostHeader(originHostHeader); + return this; + } + } + + public AfdOriginImpl withPriority(Integer priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateOriginUpdateProperties.withPriority(priority); + return this; + } + } + + public AfdOriginImpl withWeight(Integer weight) { + if (isInCreateMode()) { + this.innerModel().withWeight(weight); + return this; + } else { + this.updateOriginUpdateProperties.withWeight(weight); + return this; + } + } + + public AfdOriginImpl withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (isInCreateMode()) { + this.innerModel().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } else { + this.updateOriginUpdateProperties.withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + } + + public AfdOriginImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateOriginUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + public AfdOriginImpl withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (isInCreateMode()) { + this.innerModel().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } else { + this.updateOriginUpdateProperties.withEnforceCertificateNameCheck(enforceCertificateNameCheck); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java new file mode 100644 index 0000000000000..2ceffed91d295 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java @@ -0,0 +1,1657 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginListResult; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginUpdateParameters; +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 AfdOriginsClient. */ +public final class AfdOriginsClientImpl implements AfdOriginsClient { + /** The proxy service used to perform REST calls. */ + private final AfdOriginsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdOriginsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdOriginsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(AfdOriginsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdOrigins to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + private interface AfdOriginsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/origins") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOriginGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginInner origin, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AfdOriginUpdateParameters originUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/originGroups/{originGroupName}/origins/{originName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("originGroupName") String originGroupName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOriginGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupSinglePageAsync( + String resourceGroupName, String profileName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 + .listByOriginGroup( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupSinglePageAsync( + String resourceGroupName, String profileName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 + .listByOriginGroup( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOriginGroupAsync( + String resourceGroupName, String profileName, String originGroupName) { + return new PagedFlux<>( + () -> listByOriginGroupSinglePageAsync(resourceGroupName, profileName, originGroupName), + nextLink -> listByOriginGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOriginGroupAsync( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return new PagedFlux<>( + () -> listByOriginGroupSinglePageAsync(resourceGroupName, profileName, originGroupName, context), + nextLink -> listByOriginGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName) { + return new PagedIterable<>(listByOriginGroupAsync(resourceGroupName, profileName, originGroupName)); + } + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return new PagedIterable<>(listByOriginGroupAsync(resourceGroupName, profileName, originGroupName, context)); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String originGroupName, String originName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String originGroupName, String originName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String originGroupName, String originName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, originName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, String originName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, context).block(); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner get(String resourceGroupName, String profileName, String originGroupName, String originName) { + return getWithResponse(resourceGroupName, profileName, originGroupName, originName, Context.NONE).getValue(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + origin, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + origin, + accept, + context); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, origin); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdOriginInner.class, + AfdOriginInner.class, + this.client.getContext()); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, origin, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdOriginInner.class, AfdOriginInner.class, context); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginCreate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin).getSyncPoller(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginCreate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin, context) + .getSyncPoller(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, originGroupName, originName, origin, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner create( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin) { + return createAsync(resourceGroupName, profileName, originGroupName, originName, origin).block(); + } + + /** + * Creates a new origin within the specified origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin that is unique within the profile. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner create( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginInner origin, + Context context) { + return createAsync(resourceGroupName, profileName, originGroupName, originName, origin, context).block(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (originUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (originUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originUpdateProperties, + accept, + context); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, originGroupName, originName, originUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AfdOriginInner.class, + AfdOriginInner.class, + this.client.getContext()); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AfdOriginInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdOriginInner.class, AfdOriginInner.class, context); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Front Door origin is the source of the content being + * delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AfdOriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner update( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties) { + return updateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties).block(); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Front Door origin is the source of the content being delivered via Azure Front Door. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AfdOriginInner update( + String resourceGroupName, + String profileName, + String originGroupName, + String originName, + AfdOriginUpdateParameters originUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + originGroupName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, originName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, originGroupName, originName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName).getSyncPoller(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String originGroupName, String originName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String originGroupName, String originName) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String originGroupName, String originName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, originGroupName, originName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String originGroupName, String originName) { + deleteAsync(resourceGroupName, profileName, originGroupName, originName).block(); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String originGroupName, String originName, Context context) { + deleteAsync(resourceGroupName, profileName, originGroupName, originName, context).block(); + } + + /** + * 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 result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupNextSinglePageAsync(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.listByOriginGroupNext(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 result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOriginGroupNextSinglePageAsync(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 + .listByOriginGroupNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java new file mode 100644 index 0000000000000..5dea6919fa07a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.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.cdn.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.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigins; + +public final class AfdOriginsImpl implements AfdOrigins { + private static final ClientLogger LOGGER = new ClientLogger(AfdOriginsImpl.class); + + private final AfdOriginsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdOriginsImpl( + AfdOriginsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName) { + PagedIterable inner = + this.serviceClient().listByOriginGroup(resourceGroupName, profileName, originGroupName); + return Utils.mapPage(inner, inner1 -> new AfdOriginImpl(inner1, this.manager())); + } + + public PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByOriginGroup(resourceGroupName, profileName, originGroupName, context); + return Utils.mapPage(inner, inner1 -> new AfdOriginImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, String originName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, originGroupName, originName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AfdOriginImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AfdOrigin get(String resourceGroupName, String profileName, String originGroupName, String originName) { + AfdOriginInner inner = this.serviceClient().get(resourceGroupName, profileName, originGroupName, originName); + if (inner != null) { + return new AfdOriginImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String originGroupName, String originName) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, originName); + } + + public void delete( + String resourceGroupName, String profileName, String originGroupName, String originName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, originGroupName, originName, context); + } + + public AfdOrigin 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + return this + .getWithResponse(resourceGroupName, profileName, originGroupName, originName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, originGroupName, originName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, originName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, originGroupName, originName, context); + } + + private AfdOriginsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public AfdOriginImpl define(String name) { + return new AfdOriginImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java new file mode 100644 index 0000000000000..6aab0787f9724 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java @@ -0,0 +1,1060 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +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 AfdProfilesClient. */ +public final class AfdProfilesClientImpl implements AfdProfilesClient { + /** The proxy service used to perform REST calls. */ + private final AfdProfilesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of AfdProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AfdProfilesClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(AfdProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientAfdProfiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientA") + private interface AfdProfilesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/checkHostNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkHostnameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/validateSecret") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateSecret( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateSecretInput validateSecretInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/upgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgrade( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileUpgradeParameters profileUpgradeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, context)); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (checkHostnameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkHostnameAvailabilityInput is required and cannot be null.")); + } else { + checkHostnameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkHostnameAvailability( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + checkHostnameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, + String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (checkHostnameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkHostnameAvailabilityInput is required and cannot be null.")); + } else { + checkHostnameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkHostnameAvailability( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + checkHostnameAvailabilityInput, + accept, + context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkHostnameAvailabilityAsync( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityWithResponseAsync( + resourceGroupName, profileName, checkHostnameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + Context context) { + return checkHostnameAvailabilityWithResponseAsync( + resourceGroupName, profileName, checkHostnameAvailabilityInput, context) + .block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner checkHostnameAvailability( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityWithResponse( + resourceGroupName, profileName, checkHostnameAvailabilityInput, Context.NONE) + .getValue(); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateSecretWithResponseAsync( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (validateSecretInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); + } else { + validateSecretInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateSecret( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateSecretInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateSecretWithResponseAsync( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (validateSecretInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateSecretInput is required and cannot be null.")); + } else { + validateSecretInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateSecret( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateSecretInput, + accept, + context); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateSecretAsync( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput) { + return validateSecretWithResponseAsync(resourceGroupName, profileName, validateSecretInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateSecretWithResponse( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput, Context context) { + return validateSecretWithResponseAsync(resourceGroupName, profileName, validateSecretInput, context).block(); + } + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateSecretOutputInner validateSecret( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput) { + return validateSecretWithResponse(resourceGroupName, profileName, validateSecretInput, Context.NONE).getValue(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profileUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter profileUpgradeParameters is required and cannot be null.")); + } else { + profileUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgrade( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profileUpgradeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profileUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter profileUpgradeParameters is required and cannot be null.")); + } else { + profileUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgrade( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profileUpgradeParameters, + accept, + context); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input 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 {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpgradeAsync( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + Mono>> mono = + upgradeWithResponseAsync(resourceGroupName, profileName, profileUpgradeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input 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 {@link PollerFlux} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpgradeAsync( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeWithResponseAsync(resourceGroupName, profileName, profileUpgradeParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, context); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input 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 {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpgrade( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters).getSyncPoller(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input 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 {@link SyncPoller} for polling of a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context).getSyncPoller(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context) { + return beginUpgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner upgrade( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + return upgradeAsync(resourceGroupName, profileName, profileUpgradeParameters).block(); + } + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner upgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context) { + return upgradeAsync(resourceGroupName, profileName, profileUpgradeParameters, context).block(); + } + + /** + * 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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java new file mode 100644 index 0000000000000..0d63025e77a81 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProfiles; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretOutput; + +public final class AfdProfilesImpl implements AfdProfiles { + private static final ClientLogger LOGGER = new ClientLogger(AfdProfilesImpl.class); + + private final AfdProfilesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public AfdProfilesImpl( + AfdProfilesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + Context context) { + Response inner = + this + .serviceClient() + .checkHostnameAvailabilityWithResponse( + resourceGroupName, profileName, checkHostnameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput checkHostnameAvailability( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = + this + .serviceClient() + .checkHostnameAvailability(resourceGroupName, profileName, checkHostnameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateSecretWithResponse( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput, Context context) { + Response inner = + this + .serviceClient() + .validateSecretWithResponse(resourceGroupName, profileName, validateSecretInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateSecretOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateSecretOutput validateSecret( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput) { + ValidateSecretOutputInner inner = + this.serviceClient().validateSecret(resourceGroupName, profileName, validateSecretInput); + if (inner != null) { + return new ValidateSecretOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Profile upgrade( + String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters) { + ProfileInner inner = this.serviceClient().upgrade(resourceGroupName, profileName, profileUpgradeParameters); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Profile upgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context) { + ProfileInner inner = + this.serviceClient().upgrade(resourceGroupName, profileName, profileUpgradeParameters, context); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + private AfdProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.java new file mode 100644 index 0000000000000..d57002701b754 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CanMigrateResultImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateDefaultSku; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import java.util.Collections; +import java.util.List; + +public final class CanMigrateResultImpl implements CanMigrateResult { + private CanMigrateResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CanMigrateResultImpl( + CanMigrateResultInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean canMigrate() { + return this.innerModel().canMigrate(); + } + + public CanMigrateDefaultSku defaultSku() { + return this.innerModel().defaultSku(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CanMigrateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.java new file mode 100644 index 0000000000000..841fe261f894c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.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.cdn.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 CdnManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {CdnManagementClientImpl.class}) +public final class CdnManagementClientBuilder { + /* + * Azure Subscription ID. + */ + private String subscriptionId; + + /** + * Sets Azure Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder 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 CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder 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 CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder 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 CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder 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 CdnManagementClientBuilder. + */ + public CdnManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of CdnManagementClientImpl with the provided parameters. + * + * @return an instance of CdnManagementClientImpl. + */ + public CdnManagementClientImpl 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(); + CdnManagementClientImpl client = + new CdnManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java new file mode 100644 index 0000000000000..059bfbaf24ed6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdEndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdOriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.CdnManagementClient; +import com.azure.resourcemanager.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.SecurityPoliciesClient; +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 CdnManagementClientImpl type. */ +@ServiceClient(builder = CdnManagementClientBuilder.class) +public final class CdnManagementClientImpl implements CdnManagementClient { + /** Azure Subscription ID. */ + private final String subscriptionId; + + /** + * Gets Azure Subscription ID. + * + * @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 ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The AfdProfilesClient object to access its operations. */ + private final AfdProfilesClient afdProfiles; + + /** + * Gets the AfdProfilesClient object to access its operations. + * + * @return the AfdProfilesClient object. + */ + public AfdProfilesClient getAfdProfiles() { + return this.afdProfiles; + } + + /** The AfdCustomDomainsClient object to access its operations. */ + private final AfdCustomDomainsClient afdCustomDomains; + + /** + * Gets the AfdCustomDomainsClient object to access its operations. + * + * @return the AfdCustomDomainsClient object. + */ + public AfdCustomDomainsClient getAfdCustomDomains() { + return this.afdCustomDomains; + } + + /** The AfdEndpointsClient object to access its operations. */ + private final AfdEndpointsClient afdEndpoints; + + /** + * Gets the AfdEndpointsClient object to access its operations. + * + * @return the AfdEndpointsClient object. + */ + public AfdEndpointsClient getAfdEndpoints() { + return this.afdEndpoints; + } + + /** The AfdOriginGroupsClient object to access its operations. */ + private final AfdOriginGroupsClient afdOriginGroups; + + /** + * Gets the AfdOriginGroupsClient object to access its operations. + * + * @return the AfdOriginGroupsClient object. + */ + public AfdOriginGroupsClient getAfdOriginGroups() { + return this.afdOriginGroups; + } + + /** The AfdOriginsClient object to access its operations. */ + private final AfdOriginsClient afdOrigins; + + /** + * Gets the AfdOriginsClient object to access its operations. + * + * @return the AfdOriginsClient object. + */ + public AfdOriginsClient getAfdOrigins() { + return this.afdOrigins; + } + + /** The RoutesClient object to access its operations. */ + private final RoutesClient routes; + + /** + * Gets the RoutesClient object to access its operations. + * + * @return the RoutesClient object. + */ + public RoutesClient getRoutes() { + return this.routes; + } + + /** The RuleSetsClient object to access its operations. */ + private final RuleSetsClient ruleSets; + + /** + * Gets the RuleSetsClient object to access its operations. + * + * @return the RuleSetsClient object. + */ + public RuleSetsClient getRuleSets() { + return this.ruleSets; + } + + /** The RulesClient object to access its operations. */ + private final RulesClient rules; + + /** + * Gets the RulesClient object to access its operations. + * + * @return the RulesClient object. + */ + public RulesClient getRules() { + return this.rules; + } + + /** The SecurityPoliciesClient object to access its operations. */ + private final SecurityPoliciesClient securityPolicies; + + /** + * Gets the SecurityPoliciesClient object to access its operations. + * + * @return the SecurityPoliciesClient object. + */ + public SecurityPoliciesClient getSecurityPolicies() { + return this.securityPolicies; + } + + /** The SecretsClient object to access its operations. */ + private final SecretsClient secrets; + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + public SecretsClient getSecrets() { + return this.secrets; + } + + /** The LogAnalyticsClient object to access its operations. */ + private final LogAnalyticsClient logAnalytics; + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + public LogAnalyticsClient getLogAnalytics() { + return this.logAnalytics; + } + + /** The ProfilesClient object to access its operations. */ + private final ProfilesClient profiles; + + /** + * Gets the ProfilesClient object to access its operations. + * + * @return the ProfilesClient object. + */ + public ProfilesClient getProfiles() { + return this.profiles; + } + + /** The EndpointsClient object to access its operations. */ + private final EndpointsClient endpoints; + + /** + * Gets the EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + public EndpointsClient getEndpoints() { + return this.endpoints; + } + + /** The OriginsClient object to access its operations. */ + private final OriginsClient origins; + + /** + * Gets the OriginsClient object to access its operations. + * + * @return the OriginsClient object. + */ + public OriginsClient getOrigins() { + return this.origins; + } + + /** The OriginGroupsClient object to access its operations. */ + private final OriginGroupsClient originGroups; + + /** + * Gets the OriginGroupsClient object to access its operations. + * + * @return the OriginGroupsClient object. + */ + public OriginGroupsClient getOriginGroups() { + return this.originGroups; + } + + /** The CustomDomainsClient object to access its operations. */ + private final CustomDomainsClient customDomains; + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + public CustomDomainsClient getCustomDomains() { + return this.customDomains; + } + + /** The ResourceUsagesClient object to access its operations. */ + private final ResourceUsagesClient resourceUsages; + + /** + * Gets the ResourceUsagesClient object to access its operations. + * + * @return the ResourceUsagesClient object. + */ + public ResourceUsagesClient getResourceUsages() { + return this.resourceUsages; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The EdgeNodesClient object to access its operations. */ + private final EdgeNodesClient edgeNodes; + + /** + * Gets the EdgeNodesClient object to access its operations. + * + * @return the EdgeNodesClient object. + */ + public EdgeNodesClient getEdgeNodes() { + return this.edgeNodes; + } + + /** The PoliciesClient object to access its operations. */ + private final PoliciesClient policies; + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + public PoliciesClient getPolicies() { + return this.policies; + } + + /** The ManagedRuleSetsClient object to access its operations. */ + private final ManagedRuleSetsClient managedRuleSets; + + /** + * Gets the ManagedRuleSetsClient object to access its operations. + * + * @return the ManagedRuleSetsClient object. + */ + public ManagedRuleSetsClient getManagedRuleSets() { + return this.managedRuleSets; + } + + /** + * Initializes an instance of CdnManagementClient 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 Azure Subscription ID. + * @param endpoint server parameter. + */ + CdnManagementClientImpl( + 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 = "2022-11-01-preview"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.afdProfiles = new AfdProfilesClientImpl(this); + this.afdCustomDomains = new AfdCustomDomainsClientImpl(this); + this.afdEndpoints = new AfdEndpointsClientImpl(this); + this.afdOriginGroups = new AfdOriginGroupsClientImpl(this); + this.afdOrigins = new AfdOriginsClientImpl(this); + this.routes = new RoutesClientImpl(this); + this.ruleSets = new RuleSetsClientImpl(this); + this.rules = new RulesClientImpl(this); + this.securityPolicies = new SecurityPoliciesClientImpl(this); + this.secrets = new SecretsClientImpl(this); + this.logAnalytics = new LogAnalyticsClientImpl(this); + this.profiles = new ProfilesClientImpl(this); + this.endpoints = new EndpointsClientImpl(this); + this.origins = new OriginsClientImpl(this); + this.originGroups = new OriginGroupsClientImpl(this); + this.customDomains = new CustomDomainsClientImpl(this); + this.resourceUsages = new ResourceUsagesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.edgeNodes = new EdgeNodesClientImpl(this); + this.policies = new PoliciesClientImpl(this); + this.managedRuleSets = new ManagedRuleSetsClientImpl(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(CdnManagementClientImpl.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..090d9106ad9ff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnEndpoint; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.PolicyResourceState; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.ProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CdnWebApplicationFirewallPolicyImpl + implements CdnWebApplicationFirewallPolicy, + CdnWebApplicationFirewallPolicy.Definition, + CdnWebApplicationFirewallPolicy.Update { + private CdnWebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PolicySettings policySettings() { + return this.innerModel().policySettings(); + } + + public RateLimitRuleList rateLimitRules() { + return this.innerModel().rateLimitRules(); + } + + public CustomRuleList customRules() { + return this.innerModel().customRules(); + } + + public ManagedRuleSetList managedRules() { + return this.innerModel().managedRules(); + } + + public List endpointLinks() { + List inner = this.innerModel().endpointLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PolicyResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CdnWebApplicationFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String policyName; + + private CdnWebApplicationFirewallPolicyPatchParameters updateCdnWebApplicationFirewallPolicyPatchParameters; + + public CdnWebApplicationFirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CdnWebApplicationFirewallPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), Context.NONE); + return this; + } + + public CdnWebApplicationFirewallPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .createOrUpdate(resourceGroupName, policyName, this.innerModel(), context); + return this; + } + + CdnWebApplicationFirewallPolicyImpl( + String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new CdnWebApplicationFirewallPolicyInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public CdnWebApplicationFirewallPolicyImpl update() { + this.updateCdnWebApplicationFirewallPolicyPatchParameters = + new CdnWebApplicationFirewallPolicyPatchParameters(); + return this; + } + + public CdnWebApplicationFirewallPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .update( + resourceGroupName, policyName, updateCdnWebApplicationFirewallPolicyPatchParameters, Context.NONE); + return this; + } + + public CdnWebApplicationFirewallPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .update(resourceGroupName, policyName, updateCdnWebApplicationFirewallPolicyPatchParameters, context); + return this; + } + + CdnWebApplicationFirewallPolicyImpl( + CdnWebApplicationFirewallPolicyInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = Utils.getValueFromIdByName(innerObject.id(), "cdnWebApplicationFirewallPolicies"); + } + + public CdnWebApplicationFirewallPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public CdnWebApplicationFirewallPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPolicies() + .getByResourceGroupWithResponse(resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCdnWebApplicationFirewallPolicyPatchParameters.withTags(tags); + return this; + } + } + + public CdnWebApplicationFirewallPolicyImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withPolicySettings(PolicySettings policySettings) { + this.innerModel().withPolicySettings(policySettings); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withRateLimitRules(RateLimitRuleList rateLimitRules) { + this.innerModel().withRateLimitRules(rateLimitRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withCustomRules(CustomRuleList customRules) { + this.innerModel().withCustomRules(customRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withManagedRules(ManagedRuleSetList managedRules) { + this.innerModel().withManagedRules(managedRules); + return this; + } + + public CdnWebApplicationFirewallPolicyImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.java new file mode 100644 index 0000000000000..40f6d88cc3356 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckEndpointNameAvailabilityOutputImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityOutput; + +public final class CheckEndpointNameAvailabilityOutputImpl implements CheckEndpointNameAvailabilityOutput { + private CheckEndpointNameAvailabilityOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CheckEndpointNameAvailabilityOutputImpl( + CheckEndpointNameAvailabilityOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String availableHostname() { + return this.innerModel().availableHostname(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckEndpointNameAvailabilityOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.java new file mode 100644 index 0000000000000..40bd6a1ac8380 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; + +public final class CheckNameAvailabilityOutputImpl implements CheckNameAvailabilityOutput { + private CheckNameAvailabilityOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CheckNameAvailabilityOutputImpl( + CheckNameAvailabilityOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java new file mode 100644 index 0000000000000..3426c2ead0430 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponse; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseContinentsItem; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseCountryOrRegionsItem; +import java.util.Collections; +import java.util.List; + +public final class ContinentsResponseImpl implements ContinentsResponse { + private ContinentsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ContinentsResponseImpl( + ContinentsResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List continents() { + List inner = this.innerModel().continents(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List countryOrRegions() { + List inner = this.innerModel().countryOrRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContinentsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java new file mode 100644 index 0000000000000..66e84e5da19c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomain; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainResourceState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.CustomHttpsProvisioningSubstate; + +public final class CustomDomainImpl implements CustomDomain, CustomDomain.Definition { + private CustomDomainInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + CustomDomainImpl(CustomDomainInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public CustomDomainResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public CustomHttpsProvisioningState customHttpsProvisioningState() { + return this.innerModel().customHttpsProvisioningState(); + } + + public CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate() { + return this.innerModel().customHttpsProvisioningSubstate(); + } + + public CustomDomainHttpsParameters customHttpsParameters() { + return this.innerModel().customHttpsParameters(); + } + + public String validationData() { + return this.innerModel().validationData(); + } + + public CustomHttpsProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public CustomDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String customDomainName; + + private CustomDomainParameters createCustomDomainProperties; + + public CustomDomainImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public CustomDomain create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .create( + resourceGroupName, + profileName, + endpointName, + customDomainName, + createCustomDomainProperties, + Context.NONE); + return this; + } + + public CustomDomain create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .create( + resourceGroupName, + profileName, + endpointName, + customDomainName, + createCustomDomainProperties, + context); + return this; + } + + CustomDomainImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new CustomDomainInner(); + this.serviceManager = serviceManager; + this.customDomainName = name; + this.createCustomDomainProperties = new CustomDomainParameters(); + } + + public CustomDomain refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, Context.NONE) + .getValue(); + return this; + } + + public CustomDomain refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context) + .getValue(); + return this; + } + + public CustomDomain disableCustomHttps() { + return serviceManager + .customDomains() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + } + + public CustomDomain disableCustomHttps(Context context) { + return serviceManager + .customDomains() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + public CustomDomain enableCustomHttps() { + return serviceManager + .customDomains() + .enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + } + + public CustomDomain enableCustomHttps(CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + return serviceManager + .customDomains() + .enableCustomHttps( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context); + } + + public CustomDomainImpl withHostname(String hostname) { + this.createCustomDomainProperties.withHostname(hostname); + return this; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java new file mode 100644 index 0000000000000..1075909a78ef6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java @@ -0,0 +1,2012 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainListResult; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainParameters; +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 CustomDomainsClient. */ +public final class CustomDomainsClientImpl implements CustomDomainsClient { + /** The proxy service used to perform REST calls. */ + private final CustomDomainsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of CustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomDomainsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(CustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientCustomDomains to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientC") + private interface CustomDomainsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomDomainParameters customDomainProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableCustomHttps( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableCustomHttps( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("customDomainName") String customDomainName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomDomainHttpsParameters customDomainHttpsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner get( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, Context.NONE).getValue(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainInner.class, + CustomDomainInner.class, + this.client.getContext()); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .getSyncPoller(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context) { + return beginCreateAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, context) + .getSyncPoller(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context) { + return beginCreateAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner create( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties) { + return createAsync(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + .block(); + } + + /** + * Creates a new custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainProperties Properties required to create a new custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner create( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainParameters customDomainProperties, + Context context) { + return createAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, context) + .block(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, CustomDomainInner> beginDeleteAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainInner.class, + CustomDomainInner.class, + this.client.getContext()); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, CustomDomainInner> beginDeleteAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, CustomDomainInner> beginDelete( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName).getSyncPoller(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, CustomDomainInner> beginDelete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return deleteAsync(resourceGroupName, profileName, endpointName, customDomainName).block(); + } + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return deleteAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableCustomHttpsWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 + .disableCustomHttps( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableCustomHttpsWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 + .disableCustomHttps( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDisableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + Mono>> mono = + disableCustomHttpsWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainInner.class, + CustomDomainInner.class, + this.client.getContext()); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginDisableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName) + .getSyncPoller(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginDisableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .getSyncPoller(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return beginDisableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return disableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName).block(); + } + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return disableCustomHttpsAsync(resourceGroupName, profileName, endpointName, customDomainName, context).block(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableCustomHttpsWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainHttpsParameters != null) { + customDomainHttpsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableCustomHttps( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainHttpsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableCustomHttpsWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (customDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customDomainName 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 (customDomainHttpsParameters != null) { + customDomainHttpsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableCustomHttps( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + customDomainName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainHttpsParameters, + accept, + context); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + Mono>> mono = + enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainInner.class, + CustomDomainInner.class, + this.client.getContext()); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + Mono>> mono = + enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainInner.class, + CustomDomainInner.class, + this.client.getContext()); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainInner> beginEnableCustomHttpsAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CustomDomainInner.class, CustomDomainInner.class, context); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginEnableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return beginEnableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .getSyncPoller(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly domain name mapping to the endpoint hostname that the + * customer provides for branding purposes, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainInner> beginEnableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + return beginEnableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context) + .getSyncPoller(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + return beginEnableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return beginEnableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + return beginEnableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner enableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return enableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .block(); + } + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainInner enableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + return enableCustomHttpsAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context) + .block(); + } + + /** + * 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 result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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.listByEndpointNext(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 result of the request to list custom domains along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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 + .listByEndpointNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java new file mode 100644 index 0000000000000..44666b1d42e1e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.azure.resourcemanager.cdn.generated.models.CustomDomain; +import com.azure.resourcemanager.cdn.generated.models.CustomDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.CustomDomains; + +public final class CustomDomainsImpl implements CustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainsImpl.class); + + private final CustomDomainsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public CustomDomainsImpl( + CustomDomainsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomain get( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + CustomDomainInner inner = + this.serviceClient().get(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + CustomDomainInner inner = + this.serviceClient().delete(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + CustomDomainInner inner = + this.serviceClient().delete(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + CustomDomainInner inner = + this.serviceClient().disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + CustomDomainInner inner = + this + .serviceClient() + .disableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName, context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain enableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + CustomDomainInner inner = + this.serviceClient().enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain enableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + CustomDomainInner inner = + this + .serviceClient() + .enableCustomHttps( + resourceGroupName, + profileName, + endpointName, + customDomainName, + customDomainHttpsParameters, + context); + if (inner != null) { + return new CustomDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomDomain 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this + .getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + public CustomDomain 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.delete(resourceGroupName, profileName, endpointName, customDomainName, Context.NONE); + } + + public CustomDomain deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String customDomainName = Utils.getValueFromIdByName(id, "customDomains"); + if (customDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'customDomains'.", id))); + } + return this.delete(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + private CustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public CustomDomainImpl define(String name) { + return new CustomDomainImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java new file mode 100644 index 0000000000000..9c2effe03f744 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgeNode; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import java.util.Collections; +import java.util.List; + +public final class EdgeNodeImpl implements EdgeNode { + private EdgeNodeInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + EdgeNodeImpl(EdgeNodeInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public List ipAddressGroups() { + List inner = this.innerModel().ipAddressGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EdgeNodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java new file mode 100644 index 0000000000000..1ff98b87cb8df --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgenodeResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EdgeNodesClient. */ +public final class EdgeNodesClientImpl implements EdgeNodesClient { + /** The proxy service used to perform REST calls. */ + private final EdgeNodesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of EdgeNodesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeNodesClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(EdgeNodesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientEdgeNodes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientE") + private interface EdgeNodesService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Cdn/edgenodes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes 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 result of the request to list CDN edgenodes 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java new file mode 100644 index 0000000000000..26fe73ab9e34d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.EdgeNodesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.azure.resourcemanager.cdn.generated.models.EdgeNode; +import com.azure.resourcemanager.cdn.generated.models.EdgeNodes; + +public final class EdgeNodesImpl implements EdgeNodes { + private static final ClientLogger LOGGER = new ClientLogger(EdgeNodesImpl.class); + + private final EdgeNodesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public EdgeNodesImpl( + EdgeNodesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + private EdgeNodesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java new file mode 100644 index 0000000000000..b52be418c32ae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedCustomDomain; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOrigin; +import com.azure.resourcemanager.cdn.generated.models.DeepCreatedOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersDeliveryPolicy; +import com.azure.resourcemanager.cdn.generated.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink; +import com.azure.resourcemanager.cdn.generated.models.EndpointProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.EndpointResourceState; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.GeoFilter; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.QueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class EndpointImpl implements Endpoint, Endpoint.Definition, Endpoint.Update { + private EndpointInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public List origins() { + List inner = this.innerModel().origins(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List originGroups() { + List inner = this.innerModel().originGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EndpointResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public EndpointProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String originPath() { + return this.innerModel().originPath(); + } + + public List contentTypesToCompress() { + List inner = this.innerModel().contentTypesToCompress(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Boolean isCompressionEnabled() { + return this.innerModel().isCompressionEnabled(); + } + + public Boolean isHttpAllowed() { + return this.innerModel().isHttpAllowed(); + } + + public Boolean isHttpsAllowed() { + return this.innerModel().isHttpsAllowed(); + } + + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerModel().queryStringCachingBehavior(); + } + + public OptimizationType optimizationType() { + return this.innerModel().optimizationType(); + } + + public String probePath() { + return this.innerModel().probePath(); + } + + public List geoFilters() { + List inner = this.innerModel().geoFilters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceReference defaultOriginGroup() { + return this.innerModel().defaultOriginGroup(); + } + + public List urlSigningKeys() { + List inner = this.innerModel().urlSigningKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerModel().deliveryPolicy(); + } + + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerModel().webApplicationFirewallPolicyLink(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private EndpointUpdateParameters updateEndpointUpdateProperties; + + public EndpointImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public Endpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), Context.NONE); + return this; + } + + public Endpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .create(resourceGroupName, profileName, endpointName, this.innerModel(), context); + return this; + } + + EndpointImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new EndpointInner(); + this.serviceManager = serviceManager; + this.endpointName = name; + } + + public EndpointImpl update() { + this.updateEndpointUpdateProperties = new EndpointUpdateParameters(); + return this; + } + + public Endpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, Context.NONE); + return this; + } + + public Endpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .update(resourceGroupName, profileName, endpointName, updateEndpointUpdateProperties, context); + return this; + } + + EndpointImpl(EndpointInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "endpoints"); + } + + public Endpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE) + .getValue(); + return this; + } + + public Endpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEndpoints() + .getWithResponse(resourceGroupName, profileName, endpointName, context) + .getValue(); + return this; + } + + public Endpoint start() { + return serviceManager.endpoints().start(resourceGroupName, profileName, endpointName); + } + + public Endpoint start(Context context) { + return serviceManager.endpoints().start(resourceGroupName, profileName, endpointName, context); + } + + public Endpoint stop() { + return serviceManager.endpoints().stop(resourceGroupName, profileName, endpointName); + } + + public Endpoint stop(Context context) { + return serviceManager.endpoints().stop(resourceGroupName, profileName, endpointName, context); + } + + public void purgeContent(PurgeParameters contentFilePaths) { + serviceManager.endpoints().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void purgeContent(PurgeParameters contentFilePaths, Context context) { + serviceManager + .endpoints() + .purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public void loadContent(LoadParameters contentFilePaths) { + serviceManager.endpoints().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void loadContent(LoadParameters contentFilePaths, Context context) { + serviceManager.endpoints().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager + .endpoints() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + } + + public ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager + .endpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public PagedIterable listResourceUsage() { + return serviceManager.endpoints().listResourceUsage(resourceGroupName, profileName, endpointName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.endpoints().listResourceUsage(resourceGroupName, profileName, endpointName, context); + } + + public EndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEndpointUpdateProperties.withTags(tags); + return this; + } + } + + public EndpointImpl withOrigins(List origins) { + this.innerModel().withOrigins(origins); + return this; + } + + public EndpointImpl withOriginGroups(List originGroups) { + this.innerModel().withOriginGroups(originGroups); + return this; + } + + public EndpointImpl withOriginPath(String originPath) { + if (isInCreateMode()) { + this.innerModel().withOriginPath(originPath); + return this; + } else { + this.updateEndpointUpdateProperties.withOriginPath(originPath); + return this; + } + } + + public EndpointImpl withContentTypesToCompress(List contentTypesToCompress) { + if (isInCreateMode()) { + this.innerModel().withContentTypesToCompress(contentTypesToCompress); + return this; + } else { + this.updateEndpointUpdateProperties.withContentTypesToCompress(contentTypesToCompress); + return this; + } + } + + public EndpointImpl withOriginHostHeader(String originHostHeader) { + if (isInCreateMode()) { + this.innerModel().withOriginHostHeader(originHostHeader); + return this; + } else { + this.updateEndpointUpdateProperties.withOriginHostHeader(originHostHeader); + return this; + } + } + + public EndpointImpl withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (isInCreateMode()) { + this.innerModel().withIsCompressionEnabled(isCompressionEnabled); + return this; + } else { + this.updateEndpointUpdateProperties.withIsCompressionEnabled(isCompressionEnabled); + return this; + } + } + + public EndpointImpl withIsHttpAllowed(Boolean isHttpAllowed) { + if (isInCreateMode()) { + this.innerModel().withIsHttpAllowed(isHttpAllowed); + return this; + } else { + this.updateEndpointUpdateProperties.withIsHttpAllowed(isHttpAllowed); + return this; + } + } + + public EndpointImpl withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (isInCreateMode()) { + this.innerModel().withIsHttpsAllowed(isHttpsAllowed); + return this; + } else { + this.updateEndpointUpdateProperties.withIsHttpsAllowed(isHttpsAllowed); + return this; + } + } + + public EndpointImpl withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior) { + if (isInCreateMode()) { + this.innerModel().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } else { + this.updateEndpointUpdateProperties.withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + } + + public EndpointImpl withOptimizationType(OptimizationType optimizationType) { + if (isInCreateMode()) { + this.innerModel().withOptimizationType(optimizationType); + return this; + } else { + this.updateEndpointUpdateProperties.withOptimizationType(optimizationType); + return this; + } + } + + public EndpointImpl withProbePath(String probePath) { + if (isInCreateMode()) { + this.innerModel().withProbePath(probePath); + return this; + } else { + this.updateEndpointUpdateProperties.withProbePath(probePath); + return this; + } + } + + public EndpointImpl withGeoFilters(List geoFilters) { + if (isInCreateMode()) { + this.innerModel().withGeoFilters(geoFilters); + return this; + } else { + this.updateEndpointUpdateProperties.withGeoFilters(geoFilters); + return this; + } + } + + public EndpointImpl withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (isInCreateMode()) { + this.innerModel().withDefaultOriginGroup(defaultOriginGroup); + return this; + } else { + this.updateEndpointUpdateProperties.withDefaultOriginGroup(defaultOriginGroup); + return this; + } + } + + public EndpointImpl withUrlSigningKeys(List urlSigningKeys) { + if (isInCreateMode()) { + this.innerModel().withUrlSigningKeys(urlSigningKeys); + return this; + } else { + this.updateEndpointUpdateProperties.withUrlSigningKeys(urlSigningKeys); + return this; + } + } + + public EndpointImpl withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (isInCreateMode()) { + this.innerModel().withDeliveryPolicy(deliveryPolicy); + return this; + } else { + this.updateEndpointUpdateProperties.withDeliveryPolicy(deliveryPolicy); + return this; + } + } + + public EndpointImpl withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (isInCreateMode()) { + this.innerModel().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } else { + this.updateEndpointUpdateProperties.withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java new file mode 100644 index 0000000000000..eda81ad6243bc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java @@ -0,0 +1,3299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.EndpointListResult; +import com.azure.resourcemanager.cdn.generated.models.EndpointUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +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 EndpointsClient. */ +public final class EndpointsClientImpl implements EndpointsClient { + /** The proxy service used to perform REST calls. */ + private final EndpointsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of EndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EndpointsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(EndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientE") + private interface EndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EndpointInner endpointParam, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EndpointUpdateParameters endpointUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/purge") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeContent( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PurgeParameters contentFilePaths, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/load") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> loadContent( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LoadParameters contentFilePaths, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/validateCustomDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateCustomDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateCustomDomainInput customDomainProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/checkResourceUsage") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @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> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner get(String resourceGroupName, String profileName, String endpointName) { + return getWithResponse(resourceGroupName, profileName, endpointName, Context.NONE).getValue(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointParam, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointParam == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointParam is required and cannot be null.")); + } else { + endpointParam.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointParam, + accept, + context); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EndpointInner.class, + EndpointInner.class, + this.client.getContext()); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpointParam, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EndpointInner.class, EndpointInner.class, context); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam).getSyncPoller(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context).getSyncPoller(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpointParam, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner create( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpointParam) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam).block(); + } + + /** + * Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and + * profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointParam Endpoint properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner create( + String resourceGroupName, + String profileName, + String endpointName, + EndpointInner endpointParam, + Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpointParam, context).block(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (endpointUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter endpointUpdateProperties is required and cannot be null.")); + } else { + endpointUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpointUpdateProperties, + accept, + context); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EndpointInner.class, + EndpointInner.class, + this.client.getContext()); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EndpointInner.class, EndpointInner.class, context); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).getSyncPoller(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties).block(); + } + + /** + * Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin + * operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the + * Update Custom Domain operation. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpointUpdateProperties Endpoint update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner update( + String resourceGroupName, + String profileName, + String endpointName, + EndpointUpdateParameters endpointUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, endpointUpdateProperties, context).block(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, endpointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName) { + deleteAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStartAsync( + String resourceGroupName, String profileName, String endpointName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, profileName, endpointName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EndpointInner.class, + EndpointInner.class, + this.client.getContext()); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStartAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EndpointInner.class, EndpointInner.class, context); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStart( + String resourceGroupName, String profileName, String endpointName) { + return beginStartAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStart( + String resourceGroupName, String profileName, String endpointName, Context context) { + return beginStartAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStartAsync(resourceGroupName, profileName, endpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return beginStartAsync(resourceGroupName, profileName, endpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner start(String resourceGroupName, String profileName, String endpointName) { + return startAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner start(String resourceGroupName, String profileName, String endpointName, Context context) { + return startAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStopAsync( + String resourceGroupName, String profileName, String endpointName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, profileName, endpointName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EndpointInner.class, + EndpointInner.class, + this.client.getContext()); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointInner> beginStopAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, profileName, endpointName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EndpointInner.class, EndpointInner.class, context); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStop( + String resourceGroupName, String profileName, String endpointName) { + return beginStopAsync(resourceGroupName, profileName, endpointName).getSyncPoller(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN endpoint is the entity within a CDN profile containing + * configuration information such as origin, protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointInner> beginStop( + String resourceGroupName, String profileName, String endpointName, Context context) { + return beginStopAsync(resourceGroupName, profileName, endpointName, context).getSyncPoller(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String profileName, String endpointName) { + return beginStopAsync(resourceGroupName, profileName, endpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return beginStopAsync(resourceGroupName, profileName, endpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner stop(String resourceGroupName, String profileName, String endpointName) { + return stopAsync(resourceGroupName, profileName, endpointName).block(); + } + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointInner stop(String resourceGroupName, String profileName, String endpointName, Context context) { + return stopAsync(resourceGroupName, profileName, endpointName, context).block(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeContentWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purgeContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contentFilePaths, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> purgeContentWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purgeContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contentFilePaths, + accept, + context); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContentAsync( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).getSyncPoller(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginPurgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .getSyncPoller(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeContentAsync( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 purgeContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context) { + return beginPurgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).block(); + } + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context) { + purgeContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).block(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> loadContentWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .loadContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contentFilePaths, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> loadContentWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (contentFilePaths == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentFilePaths is required and cannot be null.")); + } else { + contentFilePaths.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .loadContent( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contentFilePaths, + accept, + context); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginLoadContentAsync( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + Mono>> mono = + loadContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginLoadContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + loadContentWithResponseAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginLoadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).getSyncPoller(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginLoadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .getSyncPoller(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 loadContentAsync( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 loadContentAsync( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context) { + return beginLoadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + loadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths).block(); + } + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 loadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context) { + loadContentAsync(resourceGroupName, profileName, endpointName, contentFilePaths, context).block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateCustomDomain( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateCustomDomainWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 (customDomainProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter customDomainProperties is required and cannot be null.")); + } else { + customDomainProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateCustomDomain( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + customDomainProperties, + accept, + context); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties, context) + .block(); + } + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateCustomDomainOutputInner validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, Context.NONE) + .getValue(); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, endpointName, 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 result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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 + .listByProfileNext(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 output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync( + 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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java new file mode 100644 index 0000000000000..8671e42efb917 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.EndpointsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import com.azure.resourcemanager.cdn.generated.models.Endpoints; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class EndpointsImpl implements Endpoints { + private static final ClientLogger LOGGER = new ClientLogger(EndpointsImpl.class); + + private final EndpointsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public EndpointsImpl( + EndpointsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new EndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new EndpointImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Endpoint get(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName); + } + + public void delete(String resourceGroupName, String profileName, String endpointName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, context); + } + + public Endpoint start(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().start(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint start(String resourceGroupName, String profileName, String endpointName, Context context) { + EndpointInner inner = this.serviceClient().start(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint stop(String resourceGroupName, String profileName, String endpointName) { + EndpointInner inner = this.serviceClient().stop(resourceGroupName, profileName, endpointName); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Endpoint stop(String resourceGroupName, String profileName, String endpointName, Context context) { + EndpointInner inner = this.serviceClient().stop(resourceGroupName, profileName, endpointName, context); + if (inner != null) { + return new EndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void purgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context) { + this.serviceClient().purgeContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public void loadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths) { + this.serviceClient().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths); + } + + public void loadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context) { + this.serviceClient().loadContent(resourceGroupName, profileName, endpointName, contentFilePaths, context); + } + + public Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + Response inner = + this + .serviceClient() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateCustomDomainOutput validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + ValidateCustomDomainOutputInner inner = + this + .serviceClient() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public Endpoint 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, context); + } + + private EndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public EndpointImpl define(String name) { + return new EndpointImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java new file mode 100644 index 0000000000000..85fa6d2d18563 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java @@ -0,0 +1,1791 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LogAnalyticsClient. */ +public final class LogAnalyticsClientImpl implements LogAnalyticsClient { + /** The proxy service used to perform REST calls. */ + private final LogAnalyticsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of LogAnalyticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogAnalyticsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientLogAnalytics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientL") + private interface LogAnalyticsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getLogAnalyticsMetrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsMetrics( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") LogMetricsGranularity granularity, + @QueryParam(value = "groupBy", multipleQueryParams = true) List groupBy, + @QueryParam(value = "continents", multipleQueryParams = true) List continents, + @QueryParam(value = "countryOrRegions", multipleQueryParams = true) List countryOrRegions, + @QueryParam(value = "customDomains", multipleQueryParams = true) List customDomains, + @QueryParam(value = "protocols", multipleQueryParams = true) List protocols, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getLogAnalyticsRankings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsRankings( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "rankings", multipleQueryParams = true) List rankings, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("maxRanking") int maxRanking, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam(value = "customDomains", multipleQueryParams = true) List customDomains, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getLogAnalyticsLocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsLocations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getLogAnalyticsResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogAnalyticsResources( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getWafLogAnalyticsMetrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getWafLogAnalyticsMetrics( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") WafGranularity granularity, + @QueryParam(value = "actions", multipleQueryParams = true) List actions, + @QueryParam(value = "groupBy", multipleQueryParams = true) List groupBy, + @QueryParam(value = "ruleTypes", multipleQueryParams = true) List ruleTypes, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getWafLogAnalyticsRankings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getWafLogAnalyticsRankings( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("profileName") String profileName, + @QueryParam(value = "metrics", multipleQueryParams = true) List metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("maxRanking") int maxRanking, + @QueryParam(value = "rankings", multipleQueryParams = true) List rankings, + @QueryParam(value = "actions", multipleQueryParams = true) List actions, + @QueryParam(value = "ruleTypes", multipleQueryParams = true) List ruleTypes, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @param groupBy Array of LogMetricsGroupBy. + * @param continents Array of Get9ItemsItem. + * @param countryOrRegions Array of Get10ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsMetricsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + if (customDomains == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomains is required and cannot be null.")); + } + if (protocols == null) { + return Mono.error(new IllegalArgumentException("Parameter protocols is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = + (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List continentsConverted = + (continents == null) + ? new ArrayList<>() + : continents.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List countryOrRegionsConverted = + (countryOrRegions == null) + ? new ArrayList<>() + : countryOrRegions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = + customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List protocolsConverted = + protocols.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .getLogAnalyticsMetrics( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + granularity, + groupByConverted, + continentsConverted, + countryOrRegionsConverted, + customDomainsConverted, + protocolsConverted, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @param groupBy Array of LogMetricsGroupBy. + * @param continents Array of Get9ItemsItem. + * @param countryOrRegions Array of Get10ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsMetricsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + if (customDomains == null) { + return Mono.error(new IllegalArgumentException("Parameter customDomains is required and cannot be null.")); + } + if (protocols == null) { + return Mono.error(new IllegalArgumentException("Parameter protocols is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = + (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List continentsConverted = + (continents == null) + ? new ArrayList<>() + : continents.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List countryOrRegionsConverted = + (countryOrRegions == null) + ? new ArrayList<>() + : countryOrRegions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = + customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List protocolsConverted = + protocols.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .getLogAnalyticsMetrics( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + granularity, + groupByConverted, + continentsConverted, + countryOrRegionsConverted, + customDomainsConverted, + protocolsConverted, + accept, + context); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsMetricsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols) { + final List groupBy = null; + final List continents = null; + final List countryOrRegions = null; + return getLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @param groupBy Array of LogMetricsGroupBy. + * @param continents Array of Get9ItemsItem. + * @param countryOrRegions Array of Get10ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions, + Context context) { + return getLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions, + context) + .block(); + } + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricsResponseInner getLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols) { + final List groupBy = null; + final List continents = null; + final List countryOrRegions = null; + return getLogAnalyticsMetricsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions, + Context.NONE) + .getValue(); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains Array of String. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + final String accept = "application/json"; + List rankingsConverted = + rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = + (customDomains == null) + ? new ArrayList<>() + : customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .getLogAnalyticsRankings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + rankingsConverted, + metricsConverted, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomainsConverted, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains Array of String. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + final String accept = "application/json"; + List rankingsConverted = + rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List customDomainsConverted = + (customDomains == null) + ? new ArrayList<>() + : customDomains.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .getLogAnalyticsRankings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + rankingsConverted, + metricsConverted, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomainsConverted, + accept, + context); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd 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 log analytics ranking report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsRankingsAsync( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + final List customDomains = null; + return getLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains Array of String. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + Context context) { + return getLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains, + context) + .block(); + } + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd 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 log analytics ranking report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RankingsResponseInner getLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + final List customDomains = null; + return getLogAnalyticsRankingsWithResponse( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains, + Context.NONE) + .getValue(); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsLocationsWithResponseAsync( + String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLogAnalyticsLocations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsLocationsWithResponseAsync( + String resourceGroupName, String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLogAnalyticsLocations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + accept, + context); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsLocationsAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsLocationsWithResponse( + String resourceGroupName, String profileName, Context context) { + return getLogAnalyticsLocationsWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsResourcesWithResponseAsync( + String resourceGroupName, String profileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLogAnalyticsResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogAnalyticsResourcesWithResponseAsync( + String resourceGroupName, String profileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLogAnalyticsResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + accept, + context); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsResourcesAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, Context context) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourcesResponseInner getLogAnalyticsResources(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions Array of WafAction. + * @param groupBy Array of WafRankingGroupBy. + * @param ruleTypes Array of WafRuleType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsMetricsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = + (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = + (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = + (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .getWafLogAnalyticsMetrics( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + granularity, + actionsConverted, + groupByConverted, + ruleTypesConverted, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions Array of WafAction. + * @param groupBy Array of WafRankingGroupBy. + * @param ruleTypes Array of WafRuleType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsMetricsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (granularity == null) { + return Mono.error(new IllegalArgumentException("Parameter granularity is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = + (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List groupByConverted = + (groupBy == null) + ? new ArrayList<>() + : groupBy.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = + (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .getWafLogAnalyticsMetrics( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + granularity, + actionsConverted, + groupByConverted, + ruleTypesConverted, + accept, + context); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity 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 waf related log analytics report for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsMetricsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity) { + final List actions = null; + final List groupBy = null; + final List ruleTypes = null; + return getWafLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions Array of WafAction. + * @param groupBy Array of WafRankingGroupBy. + * @param ruleTypes Array of WafRuleType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWafLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes, + Context context) { + return getWafLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes, + context) + .block(); + } + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity 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 waf related log analytics report for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafMetricsResponseInner getWafLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity) { + final List actions = null; + final List groupBy = null; + final List ruleTypes = null; + return getWafLogAnalyticsMetricsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes, + Context.NONE) + .getValue(); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @param actions Array of WafAction. + * @param ruleTypes Array of WafRuleType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List rankingsConverted = + rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = + (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = + (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .getWafLogAnalyticsRankings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankingsConverted, + actionsConverted, + ruleTypesConverted, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @param actions Array of WafAction. + * @param ruleTypes Array of WafRuleType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWafLogAnalyticsRankingsWithResponseAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (metrics == null) { + return Mono.error(new IllegalArgumentException("Parameter metrics is required and cannot be null.")); + } + if (dateTimeBegin == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeBegin is required and cannot be null.")); + } + if (dateTimeEnd == null) { + return Mono.error(new IllegalArgumentException("Parameter dateTimeEnd is required and cannot be null.")); + } + if (rankings == null) { + return Mono.error(new IllegalArgumentException("Parameter rankings is required and cannot be null.")); + } + final String accept = "application/json"; + List metricsConverted = + metrics.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List rankingsConverted = + rankings.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List actionsConverted = + (actions == null) + ? new ArrayList<>() + : actions.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + List ruleTypesConverted = + (ruleTypes == null) + ? new ArrayList<>() + : ruleTypes.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .getWafLogAnalyticsRankings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + profileName, + metricsConverted, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankingsConverted, + actionsConverted, + ruleTypesConverted, + accept, + context); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsRankingsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings) { + final List actions = null; + final List ruleTypes = null; + return getWafLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @param actions Array of WafAction. + * @param ruleTypes Array of WafRuleType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWafLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context) { + return getWafLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes, + context) + .block(); + } + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafRankingsResponseInner getWafLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings) { + final List actions = null; + final List ruleTypes = null; + return getWafLogAnalyticsRankingsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes, + Context.NONE) + .getValue(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java new file mode 100644 index 0000000000000..cbeba37ec2d4e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponse; +import com.azure.resourcemanager.cdn.generated.models.LogAnalytics; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponse; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRankingGroupBy; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRuleType; +import java.time.OffsetDateTime; +import java.util.List; + +public final class LogAnalyticsImpl implements LogAnalytics { + private static final ClientLogger LOGGER = new ClientLogger(LogAnalyticsImpl.class); + + private final LogAnalyticsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public LogAnalyticsImpl( + LogAnalyticsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions, + Context context) { + Response inner = + this + .serviceClient() + .getLogAnalyticsMetricsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MetricsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MetricsResponse getLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols) { + MetricsResponseInner inner = + this + .serviceClient() + .getLogAnalyticsMetrics( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols); + if (inner != null) { + return new MetricsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + Context context) { + Response inner = + this + .serviceClient() + .getLogAnalyticsRankingsWithResponse( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RankingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RankingsResponse getLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd) { + RankingsResponseInner inner = + this + .serviceClient() + .getLogAnalyticsRankings( + resourceGroupName, profileName, rankings, metrics, maxRanking, dateTimeBegin, dateTimeEnd); + if (inner != null) { + return new RankingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsLocationsWithResponse( + String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().getLogAnalyticsLocationsWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContinentsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContinentsResponse getLogAnalyticsLocations(String resourceGroupName, String profileName) { + ContinentsResponseInner inner = this.serviceClient().getLogAnalyticsLocations(resourceGroupName, profileName); + if (inner != null) { + return new ContinentsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().getLogAnalyticsResourcesWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourcesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourcesResponse getLogAnalyticsResources(String resourceGroupName, String profileName) { + ResourcesResponseInner inner = this.serviceClient().getLogAnalyticsResources(resourceGroupName, profileName); + if (inner != null) { + return new ResourcesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWafLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes, + Context context) { + Response inner = + this + .serviceClient() + .getWafLogAnalyticsMetricsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WafMetricsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WafMetricsResponse getWafLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity) { + WafMetricsResponseInner inner = + this + .serviceClient() + .getWafLogAnalyticsMetrics( + resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity); + if (inner != null) { + return new WafMetricsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWafLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context) { + Response inner = + this + .serviceClient() + .getWafLogAnalyticsRankingsWithResponse( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WafRankingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WafRankingsResponse getWafLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings) { + WafRankingsResponseInner inner = + this + .serviceClient() + .getWafLogAnalyticsRankings( + resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, maxRanking, rankings); + if (inner != null) { + return new WafRankingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private LogAnalyticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java new file mode 100644 index 0000000000000..e743283643448 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.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.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinition; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import java.util.Collections; +import java.util.List; + +public final class ManagedRuleSetDefinitionImpl implements ManagedRuleSetDefinition { + private ManagedRuleSetDefinitionInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ManagedRuleSetDefinitionImpl( + ManagedRuleSetDefinitionInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String ruleSetType() { + return this.innerModel().ruleSetType(); + } + + public String ruleSetVersion() { + return this.innerModel().ruleSetVersion(); + } + + public List ruleGroups() { + List inner = this.innerModel().ruleGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedRuleSetDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java new file mode 100644 index 0000000000000..1ff1010ee6641 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinitionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedRuleSetsClient. */ +public final class ManagedRuleSetsClientImpl implements ManagedRuleSetsClient { + /** The proxy service used to perform REST calls. */ + private final ManagedRuleSetsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ManagedRuleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedRuleSetsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(ManagedRuleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientManagedRuleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientM") + private interface ManagedRuleSetsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/cdnWebApplicationFirewallManagedRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available managed rule 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 list of managed rule set definitions available for use in a policy along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available managed rule 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 list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available managed rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all available managed rule 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 list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy 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 list of managed rule set definitions available for use in a policy 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java new file mode 100644 index 0000000000000..644dbf91b9765 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ManagedRuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetDefinition; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSets; + +public final class ManagedRuleSetsImpl implements ManagedRuleSets { + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSetsImpl.class); + + private final ManagedRuleSetsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ManagedRuleSetsImpl( + ManagedRuleSetsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + private ManagedRuleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java new file mode 100644 index 0000000000000..73a6caeea00d4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.MetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseSeriesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class MetricsResponseImpl implements MetricsResponse { + private MetricsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + MetricsResponseImpl( + MetricsResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public MetricsGranularity granularity() { + return this.innerModel().granularity(); + } + + public List series() { + List inner = this.innerModel().series(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MetricsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java new file mode 100644 index 0000000000000..f6dd1551f216e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MigrateResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.models.MigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrationErrorType; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Collections; +import java.util.List; + +public final class MigrateResultImpl implements MigrateResult { + private MigrateResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + MigrateResultImpl( + MigrateResultInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ResourceReference migratedProfileResourceId() { + return this.innerModel().migratedProfileResourceId(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MigrateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..dd75811e8a547 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.Operation; +import com.azure.resourcemanager.cdn.generated.models.OperationDisplay; +import com.azure.resourcemanager.cdn.generated.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..e0c754ce985ae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.OperationsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Cdn/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..6eee25e4ecfe5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.OperationsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.cdn.generated.models.Operation; +import com.azure.resourcemanager.cdn.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java new file mode 100644 index 0000000000000..514d39d8d7f56 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupResourceState; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Collections; +import java.util.List; + +public final class OriginGroupImpl implements OriginGroup, OriginGroup.Definition, OriginGroup.Update { + private OriginGroupInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginGroupResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public OriginGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HealthProbeParameters healthProbeSettings() { + return this.innerModel().healthProbeSettings(); + } + + public List origins() { + List inner = this.innerModel().origins(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerModel().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerModel().responseBasedOriginErrorDetectionSettings(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OriginGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String originGroupName; + + private OriginGroupUpdateParameters updateOriginGroupUpdateProperties; + + public OriginGroupImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public OriginGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .create(resourceGroupName, profileName, endpointName, originGroupName, this.innerModel(), Context.NONE); + return this; + } + + public OriginGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .create(resourceGroupName, profileName, endpointName, originGroupName, this.innerModel(), context); + return this; + } + + OriginGroupImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new OriginGroupInner(); + this.serviceManager = serviceManager; + this.originGroupName = name; + } + + public OriginGroupImpl update() { + this.updateOriginGroupUpdateProperties = new OriginGroupUpdateParameters(); + return this; + } + + public OriginGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .update( + resourceGroupName, + profileName, + endpointName, + originGroupName, + updateOriginGroupUpdateProperties, + Context.NONE); + return this; + } + + public OriginGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .update( + resourceGroupName, + profileName, + endpointName, + originGroupName, + updateOriginGroupUpdateProperties, + context); + return this; + } + + OriginGroupImpl(OriginGroupInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "endpoints"); + this.originGroupName = Utils.getValueFromIdByName(innerObject.id(), "originGroups"); + } + + public OriginGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, Context.NONE) + .getValue(); + return this; + } + + public OriginGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOriginGroups() + .getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, context) + .getValue(); + return this; + } + + public OriginGroupImpl withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (isInCreateMode()) { + this.innerModel().withHealthProbeSettings(healthProbeSettings); + return this; + } else { + this.updateOriginGroupUpdateProperties.withHealthProbeSettings(healthProbeSettings); + return this; + } + } + + public OriginGroupImpl withOrigins(List origins) { + if (isInCreateMode()) { + this.innerModel().withOrigins(origins); + return this; + } else { + this.updateOriginGroupUpdateProperties.withOrigins(origins); + return this; + } + } + + public OriginGroupImpl withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (isInCreateMode()) { + this + .innerModel() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } else { + this + .updateOriginGroupUpdateProperties + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + } + + public OriginGroupImpl withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (isInCreateMode()) { + this.innerModel().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } else { + this + .updateOriginGroupUpdateProperties + .withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java new file mode 100644 index 0000000000000..38007cded1832 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java @@ -0,0 +1,1627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupListResult; +import com.azure.resourcemanager.cdn.generated.models.OriginGroupUpdateParameters; +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 OriginGroupsClient. */ +public final class OriginGroupsClientImpl implements OriginGroupsClient { + /** The proxy service used to perform REST calls. */ + private final OriginGroupsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OriginGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OriginGroupsClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(OriginGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOriginGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + private interface OriginGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/originGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginGroupInner originGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginGroupUpdateParameters originGroupUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originGroupName") String originGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, context).block(); + } + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner get( + String resourceGroupName, String profileName, String endpointName, String originGroupName) { + return getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, Context.NONE).getValue(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroup == null) { + return Mono.error(new IllegalArgumentException("Parameter originGroup is required and cannot be null.")); + } else { + originGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroup, + accept, + context); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OriginGroupInner.class, + OriginGroupInner.class, + this.client.getContext()); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroup, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginGroupInner.class, OriginGroupInner.class, context); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup) + .getSyncPoller(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context) + .getSyncPoller(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup) { + return createAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup).block(); + } + + /** + * Creates a new origin group within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroup Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupInner originGroup, + Context context) { + return createAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroup, context).block(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroupUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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 (originGroupUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter originGroupUpdateProperties is required and cannot be null.")); + } else { + originGroupUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originGroupUpdateProperties, + accept, + context); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OriginGroupInner.class, + OriginGroupInner.class, + this.client.getContext()); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginGroupInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginGroupInner.class, OriginGroupInner.class, context); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 origin group comprising of origins is used for load balancing to + * origins when the content cannot be served from CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginGroupInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties) + .block(); + } + + /** + * Updates an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param originGroupUpdateProperties Origin group properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginGroupInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originGroupName, + OriginGroupUpdateParameters originGroupUpdateProperties, + Context context) { + return updateAsync( + resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter originGroupName 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, + profileName, + endpointName, + originGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName).getSyncPoller(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String originGroupName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String originGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String originGroupName) { + deleteAsync(resourceGroupName, profileName, endpointName, originGroupName).block(); + } + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String originGroupName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, originGroupName, context).block(); + } + + /** + * 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 result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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.listByEndpointNext(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 result of the request to list origin groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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 + .listByEndpointNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java new file mode 100644 index 0000000000000..77b7ada4a2941 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.OriginGroupsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.OriginGroups; + +public final class OriginGroupsImpl implements OriginGroups { + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupsImpl.class); + + private final OriginGroupsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OriginGroupsImpl( + OriginGroupsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new OriginGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new OriginGroupImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OriginGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OriginGroup get(String resourceGroupName, String profileName, String endpointName, String originGroupName) { + OriginGroupInner inner = + this.serviceClient().get(resourceGroupName, profileName, endpointName, originGroupName); + if (inner != null) { + return new OriginGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originGroupName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originGroupName); + } + + public void delete( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originGroupName, context); + } + + public OriginGroup 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + return this + .getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, originGroupName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originGroupName = Utils.getValueFromIdByName(id, "originGroups"); + if (originGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'originGroups'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originGroupName, context); + } + + private OriginGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public OriginGroupImpl define(String name) { + return new OriginGroupImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java new file mode 100644 index 0000000000000..d18ce75941d57 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.Origin; +import com.azure.resourcemanager.cdn.generated.models.OriginProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; + +public final class OriginImpl implements Origin, Origin.Definition, Origin.Update { + private OriginInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public OriginProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerModel().privateEndpointStatus(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer httpPort() { + return this.innerModel().httpPort(); + } + + public Integer httpsPort() { + return this.innerModel().httpsPort(); + } + + public String originHostHeader() { + return this.innerModel().originHostHeader(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public Integer weight() { + return this.innerModel().weight(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public String privateLinkAlias() { + return this.innerModel().privateLinkAlias(); + } + + public String privateLinkResourceId() { + return this.innerModel().privateLinkResourceId(); + } + + public String privateLinkLocation() { + return this.innerModel().privateLinkLocation(); + } + + public String privateLinkApprovalMessage() { + return this.innerModel().privateLinkApprovalMessage(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OriginInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String originName; + + private OriginUpdateParameters updateOriginUpdateProperties; + + public OriginImpl withExistingEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public Origin create() { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .create(resourceGroupName, profileName, endpointName, originName, this.innerModel(), Context.NONE); + return this; + } + + public Origin create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .create(resourceGroupName, profileName, endpointName, originName, this.innerModel(), context); + return this; + } + + OriginImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new OriginInner(); + this.serviceManager = serviceManager; + this.originName = name; + } + + public OriginImpl update() { + this.updateOriginUpdateProperties = new OriginUpdateParameters(); + return this; + } + + public Origin apply() { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .update( + resourceGroupName, + profileName, + endpointName, + originName, + updateOriginUpdateProperties, + Context.NONE); + return this; + } + + public Origin apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .update( + resourceGroupName, profileName, endpointName, originName, updateOriginUpdateProperties, context); + return this; + } + + OriginImpl(OriginInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "endpoints"); + this.originName = Utils.getValueFromIdByName(innerObject.id(), "origins"); + } + + public Origin refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .getWithResponse(resourceGroupName, profileName, endpointName, originName, Context.NONE) + .getValue(); + return this; + } + + public Origin refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOrigins() + .getWithResponse(resourceGroupName, profileName, endpointName, originName, context) + .getValue(); + return this; + } + + public OriginImpl withHostname(String hostname) { + if (isInCreateMode()) { + this.innerModel().withHostname(hostname); + return this; + } else { + this.updateOriginUpdateProperties.withHostname(hostname); + return this; + } + } + + public OriginImpl withHttpPort(Integer httpPort) { + if (isInCreateMode()) { + this.innerModel().withHttpPort(httpPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpPort(httpPort); + return this; + } + } + + public OriginImpl withHttpsPort(Integer httpsPort) { + if (isInCreateMode()) { + this.innerModel().withHttpsPort(httpsPort); + return this; + } else { + this.updateOriginUpdateProperties.withHttpsPort(httpsPort); + return this; + } + } + + public OriginImpl withOriginHostHeader(String originHostHeader) { + if (isInCreateMode()) { + this.innerModel().withOriginHostHeader(originHostHeader); + return this; + } else { + this.updateOriginUpdateProperties.withOriginHostHeader(originHostHeader); + return this; + } + } + + public OriginImpl withPriority(Integer priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateOriginUpdateProperties.withPriority(priority); + return this; + } + } + + public OriginImpl withWeight(Integer weight) { + if (isInCreateMode()) { + this.innerModel().withWeight(weight); + return this; + } else { + this.updateOriginUpdateProperties.withWeight(weight); + return this; + } + } + + public OriginImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.innerModel().withEnabled(enabled); + return this; + } else { + this.updateOriginUpdateProperties.withEnabled(enabled); + return this; + } + } + + public OriginImpl withPrivateLinkAlias(String privateLinkAlias) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkAlias(privateLinkAlias); + return this; + } else { + this.updateOriginUpdateProperties.withPrivateLinkAlias(privateLinkAlias); + return this; + } + } + + public OriginImpl withPrivateLinkResourceId(String privateLinkResourceId) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } else { + this.updateOriginUpdateProperties.withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + } + + public OriginImpl withPrivateLinkLocation(String privateLinkLocation) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkLocation(privateLinkLocation); + return this; + } else { + this.updateOriginUpdateProperties.withPrivateLinkLocation(privateLinkLocation); + return this; + } + } + + public OriginImpl withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } else { + this.updateOriginUpdateProperties.withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java new file mode 100644 index 0000000000000..816ecfabf17f1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java @@ -0,0 +1,1564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.OriginListResult; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; +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 OriginsClient. */ +public final class OriginsClientImpl implements OriginsClient { + /** The proxy service used to perform REST calls. */ + private final OriginsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of OriginsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OriginsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(OriginsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientOrigins to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientO") + private interface OriginsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/origins") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginInner origin, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OriginUpdateParameters originUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/endpoints/{endpointName}/origins/{originName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("originName") String originName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String originName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String originName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName, context).block(); + } + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner get(String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithResponse(resourceGroupName, profileName, endpointName, originName, Context.NONE).getValue(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + origin, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (origin == null) { + return Mono.error(new IllegalArgumentException("Parameter origin is required and cannot be null.")); + } else { + origin.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + origin, + accept, + context); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, originName, origin); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginInner.class, OriginInner.class, this.client.getContext()); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, originName, origin, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginInner.class, OriginInner.class, context); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin).getSyncPoller(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin, context) + .getSyncPoller(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, originName, origin, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner create( + String resourceGroupName, String profileName, String endpointName, String originName, OriginInner origin) { + return createAsync(resourceGroupName, profileName, endpointName, originName, origin).block(); + } + + /** + * Creates a new origin within the specified endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin that is unique within the endpoint. + * @param origin Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner create( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginInner origin, + Context context) { + return createAsync(resourceGroupName, profileName, endpointName, originName, origin, context).block(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (originUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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 (originUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter originUpdateProperties is required and cannot be null.")); + } else { + originUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + originUpdateProperties, + accept, + context); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginInner.class, OriginInner.class, this.client.getContext()); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OriginInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OriginInner.class, OriginInner.class, context); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OriginInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context) { + return beginUpdateAsync( + resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties).block(); + } + + /** + * Updates an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param originUpdateProperties Origin properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OriginInner update( + String resourceGroupName, + String profileName, + String endpointName, + String originName, + OriginUpdateParameters originUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, originName, originUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (originName == null) { + return Mono.error(new IllegalArgumentException("Parameter originName 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, + profileName, + endpointName, + originName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, originName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName).getSyncPoller(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String originName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName, context).getSyncPoller(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String originName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String originName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, originName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String originName) { + deleteAsync(resourceGroupName, profileName, endpointName, originName).block(); + } + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String originName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, originName, context).block(); + } + + /** + * 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 result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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.listByEndpointNext(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 result of the request to list origins along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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 + .listByEndpointNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java new file mode 100644 index 0000000000000..9d67f6b48646d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.OriginsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.Origin; +import com.azure.resourcemanager.cdn.generated.models.Origins; + +public final class OriginsImpl implements Origins { + private static final ClientLogger LOGGER = new ClientLogger(OriginsImpl.class); + + private final OriginsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public OriginsImpl(OriginsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new OriginImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new OriginImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, originName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OriginImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Origin get(String resourceGroupName, String profileName, String endpointName, String originName) { + OriginInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName, originName); + if (inner != null) { + return new OriginImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String originName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originName); + } + + public void delete( + String resourceGroupName, String profileName, String endpointName, String originName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, originName, context); + } + + public Origin 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, originName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, originName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "endpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'endpoints'.", id))); + } + String originName = Utils.getValueFromIdByName(id, "origins"); + if (originName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'origins'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, originName, context); + } + + private OriginsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public OriginImpl define(String name) { + return new OriginImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java new file mode 100644 index 0000000000000..9526b66e557de --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java @@ -0,0 +1,1315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyList; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicyPatchParameters; +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 PoliciesClient. */ +public final class PoliciesClientImpl implements PoliciesClient { + /** The proxy service used to perform REST calls. */ + private final PoliciesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of PoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoliciesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientP") + private interface PoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/cdnWebApplicationFirewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/cdnWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String policyName) { + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String policyName, 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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 (cdnWebApplicationFirewallPolicy == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicy is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicy.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + cdnWebApplicationFirewallPolicy, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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 (cdnWebApplicationFirewallPolicy == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicy is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicy.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + cdnWebApplicationFirewallPolicy, + accept, + context); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, + this.client.getContext()); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, + context); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy).getSyncPoller(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context) + .getSyncPoller(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy) { + return createOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy).block(); + } + + /** + * Create or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicy Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyInner cdnWebApplicationFirewallPolicy, + Context context) { + return createOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, context).block(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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 (cdnWebApplicationFirewallPolicyPatchParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicyPatchParameters is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicyPatchParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + cdnWebApplicationFirewallPolicyPatchParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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 (cdnWebApplicationFirewallPolicyPatchParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cdnWebApplicationFirewallPolicyPatchParameters is required and cannot be null.")); + } else { + cdnWebApplicationFirewallPolicyPatchParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + cdnWebApplicationFirewallPolicyPatchParameters, + accept, + context); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, + this.client.getContext()); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CdnWebApplicationFirewallPolicyInner> + beginUpdateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CdnWebApplicationFirewallPolicyInner.class, + CdnWebApplicationFirewallPolicyInner.class, + context); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters) + .getSyncPoller(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CdnWebApplicationFirewallPolicyInner> + beginUpdate( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .getSyncPoller(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner update( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters) { + return updateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters).block(); + } + + /** + * Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified + * subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param cdnWebApplicationFirewallPolicyPatchParameters CdnWebApplicationFirewallPolicy parameters to be patched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CdnWebApplicationFirewallPolicyInner update( + String resourceGroupName, + String policyName, + CdnWebApplicationFirewallPolicyPatchParameters cdnWebApplicationFirewallPolicyPatchParameters, + Context context) { + return updateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, context) + .block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName) { + 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, 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 (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName 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, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 policyName) { + return deleteWithResponseAsync(resourceGroupName, policyName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 policyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 policyName) { + deleteWithResponse(resourceGroupName, policyName, Context.NONE); + } + + /** + * 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 defines a list of WebApplicationFirewallPolicies for Azure CDN 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 defines a list of WebApplicationFirewallPolicies for Azure CDN 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java new file mode 100644 index 0000000000000..d13a6ca9c17f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.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.cdn.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.cdn.generated.fluent.PoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import com.azure.resourcemanager.cdn.generated.models.Policies; + +public final class PoliciesImpl implements Policies { + private static final ClientLogger LOGGER = new ClientLogger(PoliciesImpl.class); + + private final PoliciesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public PoliciesImpl(PoliciesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CdnWebApplicationFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CdnWebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName) { + CdnWebApplicationFirewallPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, policyName); + if (inner != null) { + return new CdnWebApplicationFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, policyName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public CdnWebApplicationFirewallPolicy 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 policyName = Utils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'cdnWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'cdnWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'cdnWebApplicationFirewallPolicies'.", + id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "cdnWebApplicationFirewallPolicies"); + if (policyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'cdnWebApplicationFirewallPolicies'.", + id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, policyName, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public CdnWebApplicationFirewallPolicyImpl define(String name) { + return new CdnWebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java new file mode 100644 index 0000000000000..9c0183b0df2ed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.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.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.ProfileProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; +import java.util.Collections; +import java.util.Map; + +public final class ProfileImpl implements Profile, Profile.Definition, Profile.Update { + private ProfileInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProfileResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public ProfileProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Map extendedProperties() { + Map inner = this.innerModel().extendedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String frontDoorId() { + return this.innerModel().frontDoorId(); + } + + public Integer originResponseTimeoutSeconds() { + return this.innerModel().originResponseTimeoutSeconds(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private ProfileUpdateParameters updateProfileUpdateParameters; + + public ProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Profile create() { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .create(resourceGroupName, profileName, this.innerModel(), Context.NONE); + return this; + } + + public Profile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .create(resourceGroupName, profileName, this.innerModel(), context); + return this; + } + + ProfileImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new ProfileInner(); + this.serviceManager = serviceManager; + this.profileName = name; + } + + public ProfileImpl update() { + this.updateProfileUpdateParameters = new ProfileUpdateParameters(); + return this; + } + + public Profile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .update(resourceGroupName, profileName, updateProfileUpdateParameters, Context.NONE); + return this; + } + + public Profile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .update(resourceGroupName, profileName, updateProfileUpdateParameters, context); + return this; + } + + ProfileImpl(ProfileInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + } + + public Profile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE) + .getValue(); + return this; + } + + public Profile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProfiles() + .getByResourceGroupWithResponse(resourceGroupName, profileName, context) + .getValue(); + return this; + } + + public void migrationCommit() { + serviceManager.profiles().migrationCommit(resourceGroupName, profileName); + } + + public void migrationCommit(Context context) { + serviceManager.profiles().migrationCommit(resourceGroupName, profileName, context); + } + + public Response generateSsoUriWithResponse(Context context) { + return serviceManager.profiles().generateSsoUriWithResponse(resourceGroupName, profileName, context); + } + + public SsoUri generateSsoUri() { + return serviceManager.profiles().generateSsoUri(resourceGroupName, profileName); + } + + public Response listSupportedOptimizationTypesWithResponse(Context context) { + return serviceManager + .profiles() + .listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, context); + } + + public SupportedOptimizationTypesListResult listSupportedOptimizationTypes() { + return serviceManager.profiles().listSupportedOptimizationTypes(resourceGroupName, profileName); + } + + public PagedIterable listResourceUsage() { + return serviceManager.profiles().listResourceUsage(resourceGroupName, profileName); + } + + public PagedIterable listResourceUsage(Context context) { + return serviceManager.profiles().listResourceUsage(resourceGroupName, profileName, context); + } + + public ProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProfileImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProfileUpdateParameters.withTags(tags); + return this; + } + } + + public ProfileImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProfileUpdateParameters.withIdentity(identity); + return this; + } + } + + public ProfileImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); + return this; + } + + public ProfileImpl withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (isInCreateMode()) { + this.innerModel().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } else { + this.updateProfileUpdateParameters.withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java new file mode 100644 index 0000000000000..0b1917691dd40 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java @@ -0,0 +1,2968 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ProfileListResult; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +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 ProfilesClient. */ +public final class ProfilesClientImpl implements ProfilesClient { + /** The proxy service used to perform REST calls. */ + private final ProfilesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProfilesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(ProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientProfiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientP") + private interface ProfilesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileInner profile, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProfileUpdateParameters profileUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> canMigrate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CanMigrateParameters canMigrateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationParameters migrationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/migrationCommit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrationCommit( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/generateSsoUri") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateSsoUri( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/getSupportedOptimizationTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedOptimizationTypes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/checkResourceUsage") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner getByResourceGroup(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, ProfileInner profile) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profile == null) { + return Mono.error(new IllegalArgumentException("Parameter profile is required and cannot be null.")); + } else { + profile.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profile, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, ProfileInner profile, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profile == null) { + return Mono.error(new IllegalArgumentException("Parameter profile is required and cannot be null.")); + } else { + profile.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profile, + accept, + context); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginCreateAsync( + String resourceGroupName, String profileName, ProfileInner profile) { + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, profile); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginCreateAsync( + String resourceGroupName, String profileName, ProfileInner profile, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, profile, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, context); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateAsync(resourceGroupName, profileName, profile).getSyncPoller(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile, Context context) { + return beginCreateAsync(resourceGroupName, profileName, profile, context).getSyncPoller(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateAsync(resourceGroupName, profileName, profile) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, ProfileInner profile, Context context) { + return beginCreateAsync(resourceGroupName, profileName, profile, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile) { + return createAsync(resourceGroupName, profileName, profile).block(); + } + + /** + * Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the + * specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profile Profile properties needed to create a new profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile, Context context) { + return createAsync(resourceGroupName, profileName, profile, context).block(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profileUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter profileUpdateParameters is required and cannot be null.")); + } else { + profileUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profileUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 (profileUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter profileUpdateParameters is required and cannot be null.")); + } else { + profileUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + profileUpdateParameters, + accept, + context); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpdateAsync( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, profileUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, this.client.getContext()); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProfileInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, profileUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProfileInner.class, ProfileInner.class, context); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters).getSyncPoller(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a profile is a logical grouping of endpoints that share the same + * settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters, context).getSyncPoller(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + return updateAsync(resourceGroupName, profileName, profileUpdateParameters).block(); + } + + /** + * Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * profile name under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param profileUpdateParameters Profile properties needed to update an existing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profile is a logical grouping of endpoints that share the same settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, profileName, profileUpdateParameters, context).block(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String profileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String profileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName) { + deleteAsync(resourceGroupName, profileName).block(); + } + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String profileName, Context context) { + deleteAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> canMigrateWithResponseAsync( + String resourceGroupName, CanMigrateParameters canMigrateParameters) { + 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.")); + } + if (canMigrateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter canMigrateParameters is required and cannot be null.")); + } else { + canMigrateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .canMigrate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + canMigrateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> canMigrateWithResponseAsync( + String resourceGroupName, CanMigrateParameters canMigrateParameters, 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.")); + } + if (canMigrateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter canMigrateParameters is required and cannot be null.")); + } else { + canMigrateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .canMigrate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + canMigrateParameters, + accept, + context); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono canMigrateAsync( + String resourceGroupName, CanMigrateParameters canMigrateParameters) { + return canMigrateWithResponseAsync(resourceGroupName, canMigrateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response canMigrateWithResponse( + String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context) { + return canMigrateWithResponseAsync(resourceGroupName, canMigrateParameters, context).block(); + } + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CanMigrateResultInner canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + return canMigrateWithResponse(resourceGroupName, canMigrateParameters, Context.NONE).getValue(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync( + String resourceGroupName, MigrationParameters migrationParameters) { + 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.")); + } + if (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .migrate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + migrationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateWithResponseAsync( + String resourceGroupName, MigrationParameters migrationParameters, 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.")); + } + if (migrationParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationParameters is required and cannot be null.")); + } else { + migrationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .migrate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + migrationParameters, + accept, + context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginMigrateAsync( + String resourceGroupName, MigrationParameters migrationParameters) { + Mono>> mono = migrateWithResponseAsync(resourceGroupName, migrationParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MigrateResultInner.class, + MigrateResultInner.class, + this.client.getContext()); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrateResultInner> beginMigrateAsync( + String resourceGroupName, MigrationParameters migrationParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + migrateWithResponseAsync(resourceGroupName, migrationParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MigrateResultInner.class, MigrateResultInner.class, context); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginMigrate( + String resourceGroupName, MigrationParameters migrationParameters) { + return beginMigrateAsync(resourceGroupName, migrationParameters).getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrateResultInner> beginMigrate( + String resourceGroupName, MigrationParameters migrationParameters, Context context) { + return beginMigrateAsync(resourceGroupName, migrationParameters, context).getSyncPoller(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync(String resourceGroupName, MigrationParameters migrationParameters) { + return beginMigrateAsync(resourceGroupName, migrationParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateAsync( + String resourceGroupName, MigrationParameters migrationParameters, Context context) { + return beginMigrateAsync(resourceGroupName, migrationParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner migrate(String resourceGroupName, MigrationParameters migrationParameters) { + return migrateAsync(resourceGroupName, migrationParameters).block(); + } + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrateResultInner migrate( + String resourceGroupName, MigrationParameters migrationParameters, Context context) { + return migrateAsync(resourceGroupName, migrationParameters, context).block(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationCommitWithResponseAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .migrationCommit( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrationCommitWithResponseAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .migrationCommit( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationCommitAsync(String resourceGroupName, String profileName) { + Mono>> mono = migrationCommitWithResponseAsync(resourceGroupName, profileName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginMigrationCommitAsync( + String resourceGroupName, String profileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + migrationCommitWithResponseAsync(resourceGroupName, profileName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationCommit(String resourceGroupName, String profileName) { + return beginMigrationCommitAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginMigrationCommit( + String resourceGroupName, String profileName, Context context) { + return beginMigrationCommitAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationCommitAsync(String resourceGroupName, String profileName) { + return beginMigrationCommitAsync(resourceGroupName, profileName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrationCommitAsync(String resourceGroupName, String profileName, Context context) { + return beginMigrationCommitAsync(resourceGroupName, profileName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void migrationCommit(String resourceGroupName, String profileName) { + migrationCommitAsync(resourceGroupName, profileName).block(); + } + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void migrationCommit(String resourceGroupName, String profileName, Context context) { + migrationCommitAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUriWithResponseAsync(String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .generateSsoUri( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUriWithResponseAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .generateSsoUri( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSsoUriAsync(String resourceGroupName, String profileName) { + return generateSsoUriWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateSsoUriWithResponse( + String resourceGroupName, String profileName, Context context) { + return generateSsoUriWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsoUriInner generateSsoUri(String resourceGroupName, String profileName) { + return generateSsoUriWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedOptimizationTypesWithResponseAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listSupportedOptimizationTypes( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedOptimizationTypesWithResponseAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listSupportedOptimizationTypes( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSupportedOptimizationTypesAsync( + String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedOptimizationTypesListResultInner listSupportedOptimizationTypes( + String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, Context.NONE).getValue(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, 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 result of the request to list profiles 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 result of the request to list profiles 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)); + } + + /** + * 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 result of the request to list profiles 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 result of the request to list profiles 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 output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync( + 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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java new file mode 100644 index 0000000000000..71efde01b3f3d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.ProfilesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrateResult; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import com.azure.resourcemanager.cdn.generated.models.Profiles; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; + +public final class ProfilesImpl implements Profiles { + private static final ClientLogger LOGGER = new ClientLogger(ProfilesImpl.class); + + private final ProfilesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ProfilesImpl(ProfilesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Profile getByResourceGroup(String resourceGroupName, String profileName) { + ProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, profileName); + if (inner != null) { + return new ProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String profileName) { + this.serviceClient().delete(resourceGroupName, profileName); + } + + public void delete(String resourceGroupName, String profileName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, context); + } + + public Response canMigrateWithResponse( + String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context) { + Response inner = + this.serviceClient().canMigrateWithResponse(resourceGroupName, canMigrateParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CanMigrateResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters) { + CanMigrateResultInner inner = this.serviceClient().canMigrate(resourceGroupName, canMigrateParameters); + if (inner != null) { + return new CanMigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters) { + MigrateResultInner inner = this.serviceClient().migrate(resourceGroupName, migrationParameters); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context) { + MigrateResultInner inner = this.serviceClient().migrate(resourceGroupName, migrationParameters, context); + if (inner != null) { + return new MigrateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void migrationCommit(String resourceGroupName, String profileName) { + this.serviceClient().migrationCommit(resourceGroupName, profileName); + } + + public void migrationCommit(String resourceGroupName, String profileName, Context context) { + this.serviceClient().migrationCommit(resourceGroupName, profileName, context); + } + + public Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().generateSsoUriWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SsoUriImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsoUri generateSsoUri(String resourceGroupName, String profileName) { + SsoUriInner inner = this.serviceClient().generateSsoUri(resourceGroupName, profileName); + if (inner != null) { + return new SsoUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context) { + Response inner = + this.serviceClient().listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedOptimizationTypesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedOptimizationTypesListResult listSupportedOptimizationTypes( + String resourceGroupName, String profileName) { + SupportedOptimizationTypesListResultInner inner = + this.serviceClient().listSupportedOptimizationTypes(resourceGroupName, profileName); + if (inner != null) { + return new SupportedOptimizationTypesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public Profile 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, profileName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, profileName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + this.delete(resourceGroupName, profileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + this.delete(resourceGroupName, profileName, context); + } + + private ProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public ProfileImpl define(String name) { + return new ProfileImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java new file mode 100644 index 0000000000000..e5abd89cd56a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponseTablesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class RankingsResponseImpl implements RankingsResponse { + private RankingsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + RankingsResponseImpl( + RankingsResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public List tables() { + List inner = this.innerModel().tables(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RankingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..f7ac9d494247a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientResourceProviders to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn" + + "/checkEndpointNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEndpointNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Cdn/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailabilityWithSubscription( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateProbe( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateProbeInput validateProbeInput, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEndpointNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + checkEndpointNameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEndpointNameAvailabilityWithResponseAsync( + String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (checkEndpointNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkEndpointNameAvailabilityInput is required and cannot be null.")); + } else { + checkEndpointNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEndpointNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + checkEndpointNameAvailabilityInput, + accept, + context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEndpointNameAvailabilityAsync( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponseAsync(resourceGroupName, checkEndpointNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + return checkEndpointNameAvailabilityWithResponseAsync( + resourceGroupName, checkEndpointNameAvailabilityInput, context) + .block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckEndpointNameAvailabilityOutputInner checkEndpointNameAvailability( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + return checkEndpointNameAvailabilityWithResponse( + resourceGroupName, checkEndpointNameAvailabilityInput, Context.NONE) + .getValue(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + checkNameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (checkNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), this.client.getApiVersion(), checkNameAvailabilityInput, accept, context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput, context).block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner checkNameAvailability( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithSubscriptionWithResponseAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + 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 (checkNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailabilityWithSubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + checkNameAvailabilityInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithSubscriptionWithResponseAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput, 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 (checkNameAvailabilityInput == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityInput is required and cannot be null.")); + } else { + checkNameAvailabilityInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailabilityWithSubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + checkNameAvailabilityInput, + accept, + context); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityWithSubscriptionAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput, context).block(); + } + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner checkNameAvailabilityWithSubscription( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithSubscriptionWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateProbeWithResponseAsync( + ValidateProbeInput validateProbeInput) { + 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 (validateProbeInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateProbeInput is required and cannot be null.")); + } else { + validateProbeInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateProbe( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateProbeInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateProbeWithResponseAsync( + ValidateProbeInput validateProbeInput, 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 (validateProbeInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter validateProbeInput is required and cannot be null.")); + } else { + validateProbeInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateProbe( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateProbeInput, + accept, + context); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateProbeAsync(ValidateProbeInput validateProbeInput) { + return validateProbeWithResponseAsync(validateProbeInput).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateProbeWithResponse( + ValidateProbeInput validateProbeInput, Context context) { + return validateProbeWithResponseAsync(validateProbeInput, context).block(); + } + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateProbeOutputInner validateProbe(ValidateProbeInput validateProbeInput) { + return validateProbeWithResponse(validateProbeInput, Context.NONE).getValue(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..9fed8227b46a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.cdn.generated.models.ResourceProviders; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeOutput; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context) { + Response inner = + this + .serviceClient() + .checkEndpointNameAvailabilityWithResponse( + resourceGroupName, checkEndpointNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckEndpointNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput) { + CheckEndpointNameAvailabilityOutputInner inner = + this.serviceClient().checkEndpointNameAvailability(resourceGroupName, checkEndpointNameAvailabilityInput); + if (inner != null) { + return new CheckEndpointNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithSubscriptionWithResponse(checkNameAvailabilityInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityOutput checkNameAvailabilityWithSubscription( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = + this.serviceClient().checkNameAvailabilityWithSubscription(checkNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateProbeWithResponse( + ValidateProbeInput validateProbeInput, Context context) { + Response inner = + this.serviceClient().validateProbeWithResponse(validateProbeInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateProbeOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateProbeOutput validateProbe(ValidateProbeInput validateProbeInput) { + ValidateProbeOutputInner inner = this.serviceClient().validateProbe(validateProbeInput); + if (inner != null) { + return new ValidateProbeOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java new file mode 100644 index 0000000000000..30a92b8841468 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageUnit; + +public final class ResourceUsageImpl implements ResourceUsage { + private ResourceUsageInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ResourceUsageImpl( + ResourceUsageInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public ResourceUsageUnit unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public ResourceUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java new file mode 100644 index 0000000000000..46d54fc32a3a0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsageListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceUsagesClient. */ +public final class ResourceUsagesClientImpl implements ResourceUsagesClient { + /** The proxy service used to perform REST calls. */ + private final ResourceUsagesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ResourceUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceUsagesClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(ResourceUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientResourceUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + private interface ResourceUsagesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given 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 output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given 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 output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given 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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API 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 output of check resource usage API 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java new file mode 100644 index 0000000000000..af5967f046c24 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceUsagesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsages; + +public final class ResourceUsagesImpl implements ResourceUsages { + private static final ClientLogger LOGGER = new ClientLogger(ResourceUsagesImpl.class); + + private final ResourceUsagesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public ResourceUsagesImpl( + ResourceUsagesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + private ResourceUsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java new file mode 100644 index 0000000000000..270d08161502c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponse; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseCustomDomainsItem; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseEndpointsItem; +import java.util.Collections; +import java.util.List; + +public final class ResourcesResponseImpl implements ResourcesResponse { + private ResourcesResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ResourcesResponseImpl( + ResourcesResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourcesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java new file mode 100644 index 0000000000000..827a10ae60956 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class RouteImpl implements Route, Route.Definition, Route.Update { + private RouteInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String endpointName() { + return this.innerModel().endpointName(); + } + + public List customDomains() { + List inner = this.innerModel().customDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceReference originGroup() { + return this.innerModel().originGroup(); + } + + public String originPath() { + return this.innerModel().originPath(); + } + + public List ruleSets() { + List inner = this.innerModel().ruleSets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedProtocols() { + List inner = this.innerModel().supportedProtocols(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List patternsToMatch() { + List inner = this.innerModel().patternsToMatch(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerModel().cacheConfiguration(); + } + + public ForwardingProtocol forwardingProtocol() { + return this.innerModel().forwardingProtocol(); + } + + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerModel().linkToDefaultDomain(); + } + + public HttpsRedirect httpsRedirect() { + return this.innerModel().httpsRedirect(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RouteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String endpointName; + + private String routeName; + + private RouteUpdateParameters updateRouteUpdateProperties; + + public RouteImpl withExistingAfdEndpoint(String resourceGroupName, String profileName, String endpointName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.endpointName = endpointName; + return this; + } + + public Route create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .create(resourceGroupName, profileName, endpointName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .create(resourceGroupName, profileName, endpointName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new RouteInner(); + this.serviceManager = serviceManager; + this.routeName = name; + } + + public RouteImpl update() { + this.updateRouteUpdateProperties = new RouteUpdateParameters(); + return this; + } + + public Route apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .update( + resourceGroupName, profileName, endpointName, routeName, updateRouteUpdateProperties, Context.NONE); + return this; + } + + public Route apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .update(resourceGroupName, profileName, endpointName, routeName, updateRouteUpdateProperties, context); + return this; + } + + RouteImpl(RouteInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "afdEndpoints"); + this.routeName = Utils.getValueFromIdByName(innerObject.id(), "routes"); + } + + public Route refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, profileName, endpointName, routeName, Context.NONE) + .getValue(); + return this; + } + + public Route refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, profileName, endpointName, routeName, context) + .getValue(); + return this; + } + + public RouteImpl withCustomDomains(List customDomains) { + if (isInCreateMode()) { + this.innerModel().withCustomDomains(customDomains); + return this; + } else { + this.updateRouteUpdateProperties.withCustomDomains(customDomains); + return this; + } + } + + public RouteImpl withOriginGroup(ResourceReference originGroup) { + if (isInCreateMode()) { + this.innerModel().withOriginGroup(originGroup); + return this; + } else { + this.updateRouteUpdateProperties.withOriginGroup(originGroup); + return this; + } + } + + public RouteImpl withOriginPath(String originPath) { + if (isInCreateMode()) { + this.innerModel().withOriginPath(originPath); + return this; + } else { + this.updateRouteUpdateProperties.withOriginPath(originPath); + return this; + } + } + + public RouteImpl withRuleSets(List ruleSets) { + if (isInCreateMode()) { + this.innerModel().withRuleSets(ruleSets); + return this; + } else { + this.updateRouteUpdateProperties.withRuleSets(ruleSets); + return this; + } + } + + public RouteImpl withSupportedProtocols(List supportedProtocols) { + if (isInCreateMode()) { + this.innerModel().withSupportedProtocols(supportedProtocols); + return this; + } else { + this.updateRouteUpdateProperties.withSupportedProtocols(supportedProtocols); + return this; + } + } + + public RouteImpl withPatternsToMatch(List patternsToMatch) { + if (isInCreateMode()) { + this.innerModel().withPatternsToMatch(patternsToMatch); + return this; + } else { + this.updateRouteUpdateProperties.withPatternsToMatch(patternsToMatch); + return this; + } + } + + public RouteImpl withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (isInCreateMode()) { + this.innerModel().withCacheConfiguration(cacheConfiguration); + return this; + } else { + this.updateRouteUpdateProperties.withCacheConfiguration(cacheConfiguration); + return this; + } + } + + public RouteImpl withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (isInCreateMode()) { + this.innerModel().withForwardingProtocol(forwardingProtocol); + return this; + } else { + this.updateRouteUpdateProperties.withForwardingProtocol(forwardingProtocol); + return this; + } + } + + public RouteImpl withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (isInCreateMode()) { + this.innerModel().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } else { + this.updateRouteUpdateProperties.withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + } + + public RouteImpl withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (isInCreateMode()) { + this.innerModel().withHttpsRedirect(httpsRedirect); + return this; + } else { + this.updateRouteUpdateProperties.withHttpsRedirect(httpsRedirect); + return this; + } + } + + public RouteImpl withEnabledState(EnabledState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateRouteUpdateProperties.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java new file mode 100644 index 0000000000000..0cf2fef160a9f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.RouteListResult; +import com.azure.resourcemanager.cdn.generated.models.RouteUpdateParameters; +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 RoutesClient. */ +public final class RoutesClientImpl implements RoutesClient { + /** The proxy service used to perform REST calls. */ + private final RoutesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RoutesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRoutes to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + private interface RoutesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/routes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpoint( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RouteInner route, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RouteUpdateParameters routeUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("endpointName") String endpointName, + @PathParam("routeName") String routeName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointSinglePageAsync( + String resourceGroupName, String profileName, String endpointName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName 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 + .listByEndpoint( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName), + nextLink -> listByEndpointNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointAsync( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedFlux<>( + () -> listByEndpointSinglePageAsync(resourceGroupName, profileName, endpointName, context), + nextLink -> listByEndpointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName)); + } + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + return new PagedIterable<>(listByEndpointAsync(resourceGroupName, profileName, endpointName, context)); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String routeName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String routeName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String routeName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, routeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String routeName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, context).block(); + } + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner get(String resourceGroupName, String profileName, String endpointName, String routeName) { + return getWithResponse(resourceGroupName, profileName, endpointName, routeName, Context.NONE).getValue(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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 (route == null) { + return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); + } else { + route.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + route, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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 (route == null) { + return Mono.error(new IllegalArgumentException("Parameter route is required and cannot be null.")); + } else { + route.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + route, + accept, + context); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, route); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, this.client.getContext()); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, route, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, context); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route).getSyncPoller(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route, context) + .getSyncPoller(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, routeName, route, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner create( + String resourceGroupName, String profileName, String endpointName, String routeName, RouteInner route) { + return createAsync(resourceGroupName, profileName, endpointName, routeName, route).block(); + } + + /** + * Creates a new route with the specified route name under the specified subscription, resource group, profile, and + * AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param route Route properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner create( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteInner route, + Context context) { + return createAsync(resourceGroupName, profileName, endpointName, routeName, route, context).block(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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 (routeUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeUpdateProperties is required and cannot be null.")); + } else { + routeUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + routeUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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 (routeUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeUpdateProperties is required and cannot be null.")); + } else { + routeUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + routeUpdateProperties, + accept, + context); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, this.client.getContext()); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RouteInner.class, RouteInner.class, context); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Routes name mapping to the any Routes or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginUpdate( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner update( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties) { + return updateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties).block(); + } + + /** + * Updates an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param routeUpdateProperties Route update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Routes name mapping to the any Routes or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner update( + String resourceGroupName, + String profileName, + String endpointName, + String routeName, + RouteUpdateParameters routeUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + if (routeName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeName 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, + profileName, + endpointName, + routeName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, routeName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, endpointName, routeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName).getSyncPoller(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String endpointName, String routeName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName, context).getSyncPoller(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String routeName) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String endpointName, String routeName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, endpointName, routeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String routeName) { + deleteAsync(resourceGroupName, profileName, endpointName, routeName).block(); + } + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String endpointName, String routeName, Context context) { + deleteAsync(resourceGroupName, profileName, endpointName, routeName, context).block(); + } + + /** + * 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 result of the request to list routes along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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.listByEndpointNext(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 result of the request to list routes along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEndpointNextSinglePageAsync(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 + .listByEndpointNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java new file mode 100644 index 0000000000000..0ae9c4b288b2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.RoutesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.Route; +import com.azure.resourcemanager.cdn.generated.models.Routes; + +public final class RoutesImpl implements Routes { + private static final ClientLogger LOGGER = new ClientLogger(RoutesImpl.class); + + private final RoutesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RoutesImpl(RoutesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context) { + PagedIterable inner = + this.serviceClient().listByEndpoint(resourceGroupName, profileName, endpointName, context); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String routeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, endpointName, routeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Route get(String resourceGroupName, String profileName, String endpointName, String routeName) { + RouteInner inner = this.serviceClient().get(resourceGroupName, profileName, endpointName, routeName); + if (inner != null) { + return new RouteImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String endpointName, String routeName) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, routeName); + } + + public void delete( + String resourceGroupName, String profileName, String endpointName, String routeName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, endpointName, routeName, context); + } + + public Route 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, routeName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, endpointName, routeName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, routeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String endpointName = Utils.getValueFromIdByName(id, "afdEndpoints"); + if (endpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'afdEndpoints'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, profileName, endpointName, routeName, context); + } + + private RoutesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public RouteImpl define(String name) { + return new RouteImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java new file mode 100644 index 0000000000000..2f838ddf4a326 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleAction; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleCondition; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.MatchProcessingBehavior; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class RuleImpl implements Rule, Rule.Definition, Rule.Update { + private RuleInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String ruleSetName() { + return this.innerModel().ruleSetName(); + } + + public Integer order() { + return this.innerModel().order(); + } + + public List conditions() { + List inner = this.innerModel().conditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerModel().matchProcessingBehavior(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String ruleSetName; + + private String ruleName; + + private RuleUpdateParameters updateRuleUpdateProperties; + + public RuleImpl withExistingRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + this.ruleSetName = ruleSetName; + return this; + } + + public Rule create() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .create(resourceGroupName, profileName, ruleSetName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public Rule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .create(resourceGroupName, profileName, ruleSetName, ruleName, this.innerModel(), context); + return this; + } + + RuleImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new RuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public RuleImpl update() { + this.updateRuleUpdateProperties = new RuleUpdateParameters(); + return this; + } + + public Rule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .update( + resourceGroupName, profileName, ruleSetName, ruleName, updateRuleUpdateProperties, Context.NONE); + return this; + } + + public Rule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .update(resourceGroupName, profileName, ruleSetName, ruleName, updateRuleUpdateProperties, context); + return this; + } + + RuleImpl(RuleInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.ruleSetName = Utils.getValueFromIdByName(innerObject.id(), "ruleSets"); + this.ruleName = Utils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public Rule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public Rule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRules() + .getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, context) + .getValue(); + return this; + } + + public RuleImpl withOrder(Integer order) { + if (isInCreateMode()) { + this.innerModel().withOrder(order); + return this; + } else { + this.updateRuleUpdateProperties.withOrder(order); + return this; + } + } + + public RuleImpl withConditions(List conditions) { + if (isInCreateMode()) { + this.innerModel().withConditions(conditions); + return this; + } else { + this.updateRuleUpdateProperties.withConditions(conditions); + return this; + } + } + + public RuleImpl withActions(List actions) { + if (isInCreateMode()) { + this.innerModel().withActions(actions); + return this; + } else { + this.updateRuleUpdateProperties.withActions(actions); + return this; + } + } + + public RuleImpl withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + if (isInCreateMode()) { + this.innerModel().withMatchProcessingBehavior(matchProcessingBehavior); + return this; + } else { + this.updateRuleUpdateProperties.withMatchProcessingBehavior(matchProcessingBehavior); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.java new file mode 100644 index 0000000000000..a05b3bddf8556 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.RuleSet; + +public final class RuleSetImpl implements RuleSet { + private RuleSetInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + RuleSetImpl(RuleSetInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public RuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java new file mode 100644 index 0000000000000..864d76575bf29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java @@ -0,0 +1,1312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.RuleSetListResult; +import com.azure.resourcemanager.cdn.generated.models.UsagesListResult; +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 RuleSetsClient. */ +public final class RuleSetsClientImpl implements RuleSetsClient { + /** The proxy service used to perform REST calls. */ + private final RuleSetsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RuleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RuleSetsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RuleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRuleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + private interface RuleSetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listResourceUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @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> listResourceUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String ruleSetName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleSetInner get(String resourceGroupName, String profileName, String ruleSetName) { + return getWithResponse(resourceGroupName, profileName, ruleSetName, Context.NONE).getValue(); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String profileName, String ruleSetName) { + return createWithResponseAsync(resourceGroupName, profileName, ruleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return createWithResponseAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleSetInner create(String resourceGroupName, String profileName, String ruleSetName) { + return createWithResponse(resourceGroupName, profileName, ruleSetName, Context.NONE).getValue(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, context).getSyncPoller(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String ruleSetName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String ruleSetName) { + deleteAsync(resourceGroupName, profileName, ruleSetName).block(); + } + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String ruleSetName, Context context) { + deleteAsync(resourceGroupName, profileName, ruleSetName, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String ruleSetName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageSinglePageAsync( + String resourceGroupName, String profileName, String ruleSetName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .listResourceUsage( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String ruleSetName) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, ruleSetName), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listResourceUsageAsync( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return new PagedFlux<>( + () -> listResourceUsageSinglePageAsync(resourceGroupName, profileName, ruleSetName, context), + nextLink -> listResourceUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String ruleSetName) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, ruleSetName)); + } + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return new PagedIterable<>(listResourceUsageAsync(resourceGroupName, profileName, ruleSetName, 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 result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list rule sets along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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 + .listByProfileNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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.listResourceUsageNext(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 list usages operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listResourceUsageNextSinglePageAsync(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 + .listResourceUsageNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java new file mode 100644 index 0000000000000..eea1d0728e08e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.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.cdn.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.cdn.generated.fluent.RuleSetsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.RuleSet; +import com.azure.resourcemanager.cdn.generated.models.RuleSets; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class RuleSetsImpl implements RuleSets { + private static final ClientLogger LOGGER = new ClientLogger(RuleSetsImpl.class); + + private final RuleSetsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RuleSetsImpl(RuleSetsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, ruleSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RuleSet get(String resourceGroupName, String profileName, String ruleSetName) { + RuleSetInner inner = this.serviceClient().get(resourceGroupName, profileName, ruleSetName); + if (inner != null) { + return new RuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + Response inner = + this.serviceClient().createWithResponse(resourceGroupName, profileName, ruleSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RuleSet create(String resourceGroupName, String profileName, String ruleSetName) { + RuleSetInner inner = this.serviceClient().create(resourceGroupName, profileName, ruleSetName); + if (inner != null) { + return new RuleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName); + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, context); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, ruleSetName); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, ruleSetName, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private RuleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java new file mode 100644 index 0000000000000..19a662afeb93d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java @@ -0,0 +1,1609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.RuleListResult; +import com.azure.resourcemanager.cdn.generated.models.RuleUpdateParameters; +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 RulesClient. */ +public final class RulesClientImpl implements RulesClient { + /** The proxy service used to perform REST calls. */ + private final RulesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of RulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RulesClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(RulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientRules to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientR") + private interface RulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/rules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRuleSet( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RuleInner rule, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RuleUpdateParameters ruleUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("ruleSetName") String ruleSetName, + @PathParam("ruleName") String ruleName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRuleSetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetSinglePageAsync( + String resourceGroupName, String profileName, String ruleSetName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .listByRuleSet( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetSinglePageAsync( + String resourceGroupName, String profileName, String ruleSetName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName 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 + .listByRuleSet( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRuleSetAsync(String resourceGroupName, String profileName, String ruleSetName) { + return new PagedFlux<>( + () -> listByRuleSetSinglePageAsync(resourceGroupName, profileName, ruleSetName), + nextLink -> listByRuleSetNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRuleSetAsync( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return new PagedFlux<>( + () -> listByRuleSetSinglePageAsync(resourceGroupName, profileName, ruleSetName, context), + nextLink -> listByRuleSetNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + return new PagedIterable<>(listByRuleSetAsync(resourceGroupName, profileName, ruleSetName)); + } + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRuleSet( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return new PagedIterable<>(listByRuleSetAsync(resourceGroupName, profileName, ruleSetName, context)); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).block(); + } + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner get(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + return getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, Context.NONE).getValue(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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 (rule == null) { + return Mono.error(new IllegalArgumentException("Parameter rule is required and cannot be null.")); + } else { + rule.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + rule, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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 (rule == null) { + return Mono.error(new IllegalArgumentException("Parameter rule is required and cannot be null.")); + } else { + rule.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + rule, + accept, + context); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginCreateAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleInner.class, RuleInner.class, this.client.getContext()); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleInner.class, RuleInner.class, context); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginCreate( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule).getSyncPoller(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginCreate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context).getSyncPoller(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner create( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, RuleInner rule) { + return createAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule).block(); + } + + /** + * Creates a new delivery rule within the specified rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param rule The delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner create( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleInner rule, + Context context) { + return createAsync(resourceGroupName, profileName, ruleSetName, ruleName, rule, context).block(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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 (ruleUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleUpdateProperties is required and cannot be null.")); + } else { + ruleUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + ruleUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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 (ruleUpdateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleUpdateProperties is required and cannot be null.")); + } else { + ruleUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + ruleUpdateProperties, + accept, + context); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleInner.class, RuleInner.class, this.client.getContext()); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RuleInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleInner.class, RuleInner.class, context); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginUpdate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Rules name mapping to the any Rules or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RuleInner> beginUpdate( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner update( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties) { + return updateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties).block(); + } + + /** + * Updates an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param ruleUpdateProperties Delivery rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Rules name mapping to the any Rules or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleInner update( + String resourceGroupName, + String profileName, + String ruleSetName, + String ruleName, + RuleUpdateParameters ruleUpdateProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName 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, + profileName, + ruleSetName, + ruleName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName).getSyncPoller(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String ruleSetName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String ruleSetName, String ruleName) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String ruleSetName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String ruleSetName, String ruleName) { + deleteAsync(resourceGroupName, profileName, ruleSetName, ruleName).block(); + } + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String ruleSetName, String ruleName, Context context) { + deleteAsync(resourceGroupName, profileName, ruleSetName, ruleName, context).block(); + } + + /** + * 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 result of the request to list rules along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetNextSinglePageAsync(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.listByRuleSetNext(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 result of the request to list rules along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSetNextSinglePageAsync(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 + .listByRuleSetNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java new file mode 100644 index 0000000000000..4b924076ab484 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.RulesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import com.azure.resourcemanager.cdn.generated.models.Rules; + +public final class RulesImpl implements Rules { + private static final ClientLogger LOGGER = new ClientLogger(RulesImpl.class); + + private final RulesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public RulesImpl(RulesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName) { + PagedIterable inner = + this.serviceClient().listByRuleSet(resourceGroupName, profileName, ruleSetName); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public PagedIterable listByRuleSet( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + PagedIterable inner = + this.serviceClient().listByRuleSet(resourceGroupName, profileName, ruleSetName, context); + return Utils.mapPage(inner, inner1 -> new RuleImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Rule get(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + RuleInner inner = this.serviceClient().get(resourceGroupName, profileName, ruleSetName, ruleName); + if (inner != null) { + return new RuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, ruleName); + } + + public void delete( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, ruleSetName, ruleName, context); + } + + public Rule 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "ruleSets"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleSets'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "ruleSets"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleSets'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, ruleSetName, ruleName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "ruleSets"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleSets'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.delete(resourceGroupName, profileName, ruleSetName, ruleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "ruleSets"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleSets'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.delete(resourceGroupName, profileName, ruleSetName, ruleName, context); + } + + private RulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public RuleImpl define(String name) { + return new RuleImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java new file mode 100644 index 0000000000000..08926e1581eae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.Secret; +import com.azure.resourcemanager.cdn.generated.models.SecretParameters; + +public final class SecretImpl implements Secret, Secret.Definition { + private SecretInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SecretImpl(SecretInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public SecretParameters parameters() { + return this.innerModel().parameters(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SecretInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String secretName; + + public SecretImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public Secret create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .create(resourceGroupName, profileName, secretName, this.innerModel(), Context.NONE); + return this; + } + + public Secret create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .create(resourceGroupName, profileName, secretName, this.innerModel(), context); + return this; + } + + SecretImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new SecretInner(); + this.serviceManager = serviceManager; + this.secretName = name; + } + + public Secret refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, profileName, secretName, Context.NONE) + .getValue(); + return this; + } + + public Secret refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, profileName, secretName, context) + .getValue(); + return this; + } + + public SecretImpl withParameters(SecretParameters parameters) { + this.innerModel().withParameters(parameters); + return this; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java new file mode 100644 index 0000000000000..1232a2ab0772a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java @@ -0,0 +1,1120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.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.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.SecretListResult; +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 SecretsClient. */ +public final class SecretsClientImpl implements SecretsClient { + /** The proxy service used to perform REST calls. */ + private final SecretsService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of SecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsClientImpl(CdnManagementClientImpl client) { + this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientSecrets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientS") + private interface SecretsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/secrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/secrets/{secretName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/secrets/{secretName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecretInner secret, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/secrets/{secretName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("secretName") String secretName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String secretName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String secretName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String secretName) { + return getWithResponseAsync(resourceGroupName, profileName, secretName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String secretName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, secretName, context).block(); + } + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner get(String resourceGroupName, String profileName, String secretName) { + return getWithResponse(resourceGroupName, profileName, secretName, Context.NONE).getValue(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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 (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + secret, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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 (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + secret, + accept, + context); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretInner> beginCreateAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, secretName, secret); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, this.client.getContext()); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretInner> beginCreateAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, secretName, secret, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, context); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretInner> beginCreate( + String resourceGroupName, String profileName, String secretName, SecretInner secret) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret).getSyncPoller(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 friendly Secret name mapping to the any Secret or secret related + * information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretInner> beginCreate( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret, context).getSyncPoller(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context) { + return beginCreateAsync(resourceGroupName, profileName, secretName, secret, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner create(String resourceGroupName, String profileName, String secretName, SecretInner secret) { + return createAsync(resourceGroupName, profileName, secretName, secret).block(); + } + + /** + * Creates a new Secret within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param secret The Secret properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly Secret name mapping to the any Secret or secret related information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner create( + String resourceGroupName, String profileName, String secretName, SecretInner secret, Context context) { + return createAsync(resourceGroupName, profileName, secretName, secret, context).block(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName 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, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, secretName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, secretName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName) { + return beginDeleteAsync(resourceGroupName, profileName, secretName).getSyncPoller(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String secretName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, secretName, context).getSyncPoller(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String secretName) { + return beginDeleteAsync(resourceGroupName, profileName, secretName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String secretName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, secretName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String secretName) { + deleteAsync(resourceGroupName, profileName, secretName).block(); + } + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String secretName, Context context) { + deleteAsync(resourceGroupName, profileName, secretName, context).block(); + } + + /** + * 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 result of the request to list secrets along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list secrets along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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 + .listByProfileNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java new file mode 100644 index 0000000000000..7c4ed87acfa8e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.SecretsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.cdn.generated.models.Secret; +import com.azure.resourcemanager.cdn.generated.models.Secrets; + +public final class SecretsImpl implements Secrets { + private static final ClientLogger LOGGER = new ClientLogger(SecretsImpl.class); + + private final SecretsClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public SecretsImpl(SecretsClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String secretName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, secretName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Secret get(String resourceGroupName, String profileName, String secretName) { + SecretInner inner = this.serviceClient().get(resourceGroupName, profileName, secretName); + if (inner != null) { + return new SecretImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String secretName) { + this.serviceClient().delete(resourceGroupName, profileName, secretName); + } + + public void delete(String resourceGroupName, String profileName, String secretName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, secretName, context); + } + + public Secret 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, secretName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, secretName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.delete(resourceGroupName, profileName, secretName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.delete(resourceGroupName, profileName, secretName, context); + } + + private SecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public SecretImpl define(String name) { + return new SecretImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java new file mode 100644 index 0000000000000..31a9da7c66803 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java @@ -0,0 +1,1520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.SecurityPoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyListResult; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; +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 SecurityPoliciesClient. */ +public final class SecurityPoliciesClientImpl implements SecurityPoliciesClient { + /** The proxy service used to perform REST calls. */ + private final SecurityPoliciesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of SecurityPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityPoliciesClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(SecurityPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientSecurityPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientS") + private interface SecurityPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/securityPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecurityPolicyInner securityPolicy, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> patch( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/securityPolicies/{securityPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("profileName") String profileName, + @PathParam("securityPolicyName") String securityPolicyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileSinglePageAsync( + String resourceGroupName, String profileName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName 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 + .listByProfile( + this.client.getEndpoint(), + resourceGroupName, + profileName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName), + nextLink -> listByProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProfileAsync( + String resourceGroupName, String profileName, Context context) { + return new PagedFlux<>( + () -> listByProfileSinglePageAsync(resourceGroupName, profileName, context), + nextLink -> listByProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName)); + } + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProfile( + String resourceGroupName, String profileName, Context context) { + return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context)); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String securityPolicyName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String profileName, String securityPolicyName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String securityPolicyName) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName, context).block(); + } + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner get(String resourceGroupName, String profileName, String securityPolicyName) { + return getWithResponse(resourceGroupName, profileName, securityPolicyName, Context.NONE).getValue(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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 (securityPolicy == null) { + return Mono.error(new IllegalArgumentException("Parameter securityPolicy is required and cannot be null.")); + } else { + securityPolicy.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + securityPolicy, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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 (securityPolicy == null) { + return Mono.error(new IllegalArgumentException("Parameter securityPolicy is required and cannot be null.")); + } else { + securityPolicy.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + securityPolicy, + accept, + context); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginCreateAsync( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityPolicyInner.class, + SecurityPolicyInner.class, + this.client.getContext()); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginCreateAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecurityPolicyInner.class, SecurityPolicyInner.class, context); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginCreate( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy).getSyncPoller(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginCreate( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context) + .getSyncPoller(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context) { + return beginCreateAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner create( + String resourceGroupName, String profileName, String securityPolicyName, SecurityPolicyInner securityPolicy) { + return createAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy).block(); + } + + /** + * Creates a new security policy within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicy The security policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner create( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyInner securityPolicy, + Context context) { + return createAsync(resourceGroupName, profileName, securityPolicyName, securityPolicy, context).block(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchWithResponseAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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 (securityPolicyUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPolicyUpdateProperties is required and cannot be null.")); + } else { + securityPolicyUpdateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + securityPolicyUpdateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchWithResponseAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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 (securityPolicyUpdateProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter securityPolicyUpdateProperties is required and cannot be null.")); + } else { + securityPolicyUpdateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + resourceGroupName, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + securityPolicyUpdateProperties, + accept, + context); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginPatchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + Mono>> mono = + patchWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityPolicyInner.class, + SecurityPolicyInner.class, + this.client.getContext()); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecurityPolicyInner> beginPatchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + patchWithResponseAsync( + resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecurityPolicyInner.class, SecurityPolicyInner.class, context); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties) + .getSyncPoller(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + return beginPatchAsync( + resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + return beginPatchAsync( + resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner patch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties).block(); + } + + /** + * Updates an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param securityPolicyUpdateProperties Security policy update properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return securityPolicy association for AzureFrontDoor profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPolicyInner patch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyUpdateParameters securityPolicyUpdateProperties, + Context context) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, context) + .block(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName) { + 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName, 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 (profileName == null) { + return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null.")); + } + if (securityPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityPolicyName 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, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, securityPolicyName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, profileName, securityPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName).getSyncPoller(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 profileName, String securityPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName, context).getSyncPoller(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String securityPolicyName) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 profileName, String securityPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, securityPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String securityPolicyName) { + deleteAsync(resourceGroupName, profileName, securityPolicyName).block(); + } + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 profileName, String securityPolicyName, Context context) { + deleteAsync(resourceGroupName, profileName, securityPolicyName, context).block(); + } + + /** + * 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 result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 result of the request to list security policies along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProfileNextSinglePageAsync( + 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 + .listByProfileNext(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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java new file mode 100644 index 0000000000000..1c488a943f7d0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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.cdn.generated.fluent.SecurityPoliciesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicies; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; + +public final class SecurityPoliciesImpl implements SecurityPolicies { + private static final ClientLogger LOGGER = new ClientLogger(SecurityPoliciesImpl.class); + + private final SecurityPoliciesClient innerClient; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public SecurityPoliciesImpl( + SecurityPoliciesClient innerClient, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return Utils.mapPage(inner, inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return Utils.mapPage(inner, inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, profileName, securityPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityPolicy get(String resourceGroupName, String profileName, String securityPolicyName) { + SecurityPolicyInner inner = this.serviceClient().get(resourceGroupName, profileName, securityPolicyName); + if (inner != null) { + return new SecurityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String profileName, String securityPolicyName) { + this.serviceClient().delete(resourceGroupName, profileName, securityPolicyName); + } + + public void delete(String resourceGroupName, String profileName, String securityPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, profileName, securityPolicyName, context); + } + + public SecurityPolicy 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String securityPolicyName = Utils.getValueFromIdByName(id, "securityPolicies"); + if (securityPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, securityPolicyName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String securityPolicyName = Utils.getValueFromIdByName(id, "securityPolicies"); + if (securityPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, profileName, securityPolicyName, 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 profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String securityPolicyName = Utils.getValueFromIdByName(id, "securityPolicies"); + if (securityPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPolicies'.", id))); + } + this.delete(resourceGroupName, profileName, securityPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String profileName = Utils.getValueFromIdByName(id, "profiles"); + if (profileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'profiles'.", id))); + } + String securityPolicyName = Utils.getValueFromIdByName(id, "securityPolicies"); + if (securityPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPolicies'.", id))); + } + this.delete(resourceGroupName, profileName, securityPolicyName, context); + } + + private SecurityPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + public SecurityPolicyImpl define(String name) { + return new SecurityPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java new file mode 100644 index 0000000000000..4558edb9ce7f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.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.cdn.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyPropertiesParameters; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyUpdateParameters; + +public final class SecurityPolicyImpl implements SecurityPolicy, SecurityPolicy.Definition, SecurityPolicy.Update { + private SecurityPolicyInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String profileName() { + return this.innerModel().profileName(); + } + + public SecurityPolicyPropertiesParameters parameters() { + return this.innerModel().parameters(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecurityPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String securityPolicyName; + + private SecurityPolicyUpdateParameters updateSecurityPolicyUpdateProperties; + + public SecurityPolicyImpl withExistingProfile(String resourceGroupName, String profileName) { + this.resourceGroupName = resourceGroupName; + this.profileName = profileName; + return this; + } + + public SecurityPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .create(resourceGroupName, profileName, securityPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .create(resourceGroupName, profileName, securityPolicyName, this.innerModel(), context); + return this; + } + + SecurityPolicyImpl(String name, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = new SecurityPolicyInner(); + this.serviceManager = serviceManager; + this.securityPolicyName = name; + } + + public SecurityPolicyImpl update() { + this.updateSecurityPolicyUpdateProperties = new SecurityPolicyUpdateParameters(); + return this; + } + + public SecurityPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .patch( + resourceGroupName, + profileName, + securityPolicyName, + updateSecurityPolicyUpdateProperties, + Context.NONE); + return this; + } + + public SecurityPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .patch( + resourceGroupName, profileName, securityPolicyName, updateSecurityPolicyUpdateProperties, context); + return this; + } + + SecurityPolicyImpl( + SecurityPolicyInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.securityPolicyName = Utils.getValueFromIdByName(innerObject.id(), "securityPolicies"); + } + + public SecurityPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .getWithResponse(resourceGroupName, profileName, securityPolicyName, Context.NONE) + .getValue(); + return this; + } + + public SecurityPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .getWithResponse(resourceGroupName, profileName, securityPolicyName, context) + .getValue(); + return this; + } + + public SecurityPolicyImpl withParameters(SecurityPolicyPropertiesParameters parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateSecurityPolicyUpdateProperties.withParameters(parameters); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java new file mode 100644 index 0000000000000..e3a07853880aa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; +import com.azure.resourcemanager.cdn.generated.models.SsoUri; + +public final class SsoUriImpl implements SsoUri { + private SsoUriInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SsoUriImpl(SsoUriInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String ssoUriValue() { + return this.innerModel().ssoUriValue(); + } + + public SsoUriInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java new file mode 100644 index 0000000000000..284d374f695d7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.azure.resourcemanager.cdn.generated.models.SupportedOptimizationTypesListResult; +import java.util.Collections; +import java.util.List; + +public final class SupportedOptimizationTypesListResultImpl implements SupportedOptimizationTypesListResult { + private SupportedOptimizationTypesListResultInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + SupportedOptimizationTypesListResultImpl( + SupportedOptimizationTypesListResultInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedOptimizationTypes() { + List inner = this.innerModel().supportedOptimizationTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SupportedOptimizationTypesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..c621d722ab923 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.cdn.generated.models.Usage; +import com.azure.resourcemanager.cdn.generated.models.UsageName; +import com.azure.resourcemanager.cdn.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public long currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/Utils.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/Utils.java new file mode 100644 index 0000000000000..cecfbf15a8c64 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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.cdn.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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateCustomDomainOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateCustomDomainOutputImpl.java new file mode 100644 index 0000000000000..2a1285f264882 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateCustomDomainOutputImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainOutput; + +public final class ValidateCustomDomainOutputImpl implements ValidateCustomDomainOutput { + private ValidateCustomDomainOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateCustomDomainOutputImpl( + ValidateCustomDomainOutputInner innerObject, + com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean customDomainValidated() { + return this.innerModel().customDomainValidated(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateCustomDomainOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java new file mode 100644 index 0000000000000..9e4c02e092959 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeOutput; + +public final class ValidateProbeOutputImpl implements ValidateProbeOutput { + private ValidateProbeOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateProbeOutputImpl( + ValidateProbeOutputInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isValid() { + return this.innerModel().isValid(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateProbeOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java new file mode 100644 index 0000000000000..f41a483492ccd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.Status; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretOutput; + +public final class ValidateSecretOutputImpl implements ValidateSecretOutput { + private ValidateSecretOutputInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + ValidateSecretOutputImpl( + ValidateSecretOutputInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Status status() { + return this.innerModel().status(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateSecretOutputInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java new file mode 100644 index 0000000000000..395f5b20f6e28 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.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.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseSeriesItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WafMetricsResponseImpl implements WafMetricsResponse { + private WafMetricsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + WafMetricsResponseImpl( + WafMetricsResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public WafMetricsGranularity granularity() { + return this.innerModel().granularity(); + } + + public List series() { + List inner = this.innerModel().series(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WafMetricsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java new file mode 100644 index 0000000000000..6488e843061e5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponseDataItem; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WafRankingsResponseImpl implements WafRankingsResponse { + private WafRankingsResponseInner innerObject; + + private final com.azure.resourcemanager.cdn.generated.CdnManager serviceManager; + + WafRankingsResponseImpl( + WafRankingsResponseInner innerObject, com.azure.resourcemanager.cdn.generated.CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public List groups() { + List inner = this.innerModel().groups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List data() { + List inner = this.innerModel().data(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WafRankingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cdn.generated.CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java new file mode 100644 index 0000000000000..16605ebd148b2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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 CdnManagementClient. Cdn Management Client. */ +package com.azure.resourcemanager.cdn.generated.implementation; diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.java new file mode 100644 index 0000000000000..fcaa958fda47f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the action to take on rule match. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Allow for ActionType. */ + public static final ActionType ALLOW = fromString("Allow"); + + /** Static value Block for ActionType. */ + public static final ActionType BLOCK = fromString("Block"); + + /** Static value Log for ActionType. */ + public static final ActionType LOG = fromString("Log"); + + /** Static value Redirect for ActionType. */ + public static final ActionType REDIRECT = fromString("Redirect"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.java new file mode 100644 index 0000000000000..28cb9709f085d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActivatedResourceReference.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to another resource along with its state. */ +@Fluent +public final class ActivatedResourceReference { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Whether the resource is active or inactive + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /** Creates an instance of ActivatedResourceReference class. */ + public ActivatedResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ActivatedResourceReference object itself. + */ + public ActivatedResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the isActive property: Whether the resource is active or inactive. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.java new file mode 100644 index 0000000000000..302bfad2e01fe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the source of the SSL certificate. */ +public final class AfdCertificateType extends ExpandableStringEnum { + /** Static value CustomerCertificate for AfdCertificateType. */ + public static final AfdCertificateType CUSTOMER_CERTIFICATE = fromString("CustomerCertificate"); + + /** Static value ManagedCertificate for AfdCertificateType. */ + public static final AfdCertificateType MANAGED_CERTIFICATE = fromString("ManagedCertificate"); + + /** Static value AzureFirstPartyManagedCertificate for AfdCertificateType. */ + public static final AfdCertificateType AZURE_FIRST_PARTY_MANAGED_CERTIFICATE = + fromString("AzureFirstPartyManagedCertificate"); + + /** + * Creates or finds a AfdCertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdCertificateType. + */ + @JsonCreator + public static AfdCertificateType fromString(String name) { + return fromString(name, AfdCertificateType.class); + } + + /** + * Gets known AfdCertificateType values. + * + * @return known AfdCertificateType values. + */ + public static Collection values() { + return values(AfdCertificateType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java new file mode 100644 index 0000000000000..2c32b7c22aea9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 AfdCustomDomains. */ +public interface AfdCustomDomains { + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + */ + AfdDomain get(String resourceGroupName, String profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String customDomainName); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 profileName, String customDomainName, Context context); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refreshValidationToken(String resourceGroupName, String profileName, String customDomainName); + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param customDomainName Name of the domain under the profile which is unique globally. + * @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 refreshValidationToken(String resourceGroupName, String profileName, String customDomainName, Context context); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @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 an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + AfdDomain getById(String id); + + /** + * Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource + * group and profile. + * + * @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 an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @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 an existing AzureFrontDoor domain with the specified domain name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdDomain resource. + * + * @param name resource name. + * @return the first stage of the new AfdDomain definition. + */ + AfdDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java new file mode 100644 index 0000000000000..9bf42f8c466a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import java.util.Map; + +/** An immutable client-side representation of AfdDomain. */ +public interface AfdDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the domainValidationState property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for DomainControlValidation. + * + * @return the domainValidationState value. + */ + DomainValidationState domainValidationState(); + + /** + * Gets the hostname property: The host name of the domain. Must be a domain name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the extendedProperties property: Key-Value pair representing migration properties for domains. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + DomainValidationProperties validationProperties(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + AfdDomainHttpsParameters tlsSettings(); + + /** + * Gets the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + ResourceReference azureDnsZone(); + + /** + * Gets the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom + * domain ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + ResourceReference preValidatedCustomDomainResourceId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner object. + * + * @return the inner object. + */ + AfdDomainInner innerModel(); + + /** The entirety of the AfdDomain definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AfdDomain definition stages. */ + interface DefinitionStages { + /** The first stage of the AfdDomain definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AfdDomain definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the AfdDomain 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.WithHostname, + DefinitionStages.WithExtendedProperties, + DefinitionStages.WithTlsSettings, + DefinitionStages.WithAzureDnsZone, + DefinitionStages.WithPreValidatedCustomDomainResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdDomain create(Context context); + } + /** The stage of the AfdDomain definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The host name of the domain. Must be a domain name.. + * + * @param hostname The host name of the domain. Must be a domain name. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + /** The stage of the AfdDomain definition allowing to specify extendedProperties. */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: Key-Value pair representing migration properties for domains.. + * + * @param extendedProperties Key-Value pair representing migration properties for domains. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Map extendedProperties); + } + /** The stage of the AfdDomain definition allowing to specify tlsSettings. */ + interface WithTlsSettings { + /** + * Specifies the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - + * using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses + * AzureFrontDoor managed certificate by default.. + * + * @param tlsSettings The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor + * managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * @return the next definition stage. + */ + WithCreate withTlsSettings(AfdDomainHttpsParameters tlsSettings); + } + /** The stage of the AfdDomain definition allowing to specify azureDnsZone. */ + interface WithAzureDnsZone { + /** + * Specifies the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone Resource reference to the Azure DNS zone. + * @return the next definition stage. + */ + WithCreate withAzureDnsZone(ResourceReference azureDnsZone); + } + /** The stage of the AfdDomain definition allowing to specify preValidatedCustomDomainResourceId. */ + interface WithPreValidatedCustomDomainResourceId { + /** + * Specifies the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where + * custom domain ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * @return the next definition stage. + */ + WithCreate withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId); + } + } + /** + * Begins update for the AfdDomain resource. + * + * @return the stage of resource update. + */ + AfdDomain.Update update(); + + /** The template for AfdDomain update. */ + interface Update + extends UpdateStages.WithTlsSettings, + UpdateStages.WithAzureDnsZone, + UpdateStages.WithPreValidatedCustomDomainResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdDomain apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdDomain apply(Context context); + } + /** The AfdDomain update stages. */ + interface UpdateStages { + /** The stage of the AfdDomain update allowing to specify tlsSettings. */ + interface WithTlsSettings { + /** + * Specifies the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - + * using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses + * AzureFrontDoor managed certificate by default.. + * + * @param tlsSettings The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor + * managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * @return the next definition stage. + */ + Update withTlsSettings(AfdDomainHttpsParameters tlsSettings); + } + /** The stage of the AfdDomain update allowing to specify azureDnsZone. */ + interface WithAzureDnsZone { + /** + * Specifies the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone Resource reference to the Azure DNS zone. + * @return the next definition stage. + */ + Update withAzureDnsZone(ResourceReference azureDnsZone); + } + /** The stage of the AfdDomain update allowing to specify preValidatedCustomDomainResourceId. */ + interface WithPreValidatedCustomDomainResourceId { + /** + * Specifies the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where + * custom domain ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * @return the next definition stage. + */ + Update withPreValidatedCustomDomainResourceId(ResourceReference preValidatedCustomDomainResourceId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdDomain refresh(Context context); + + /** + * Updates the domain validation token. + * + * @throws com.azure.core.management.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 refreshValidationToken(); + + /** + * Updates the domain validation token. + * + * @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 refreshValidationToken(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java new file mode 100644 index 0000000000000..8051af273678d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to secure a domain. */ +@Fluent +public final class AfdDomainHttpsParameters { + /* + * Defines the source of the SSL certificate. + */ + @JsonProperty(value = "certificateType", required = true) + private AfdCertificateType certificateType; + + /* + * TLS protocol version that will be used for Https + */ + @JsonProperty(value = "minimumTlsVersion") + private AfdMinimumTlsVersion minimumTlsVersion; + + /* + * Resource reference to the secret. ie. subs/rg/profile/secret + */ + @JsonProperty(value = "secret") + private ResourceReference secret; + + /** Creates an instance of AfdDomainHttpsParameters class. */ + public AfdDomainHttpsParameters() { + } + + /** + * Get the certificateType property: Defines the source of the SSL certificate. + * + * @return the certificateType value. + */ + public AfdCertificateType certificateType() { + return this.certificateType; + } + + /** + * Set the certificateType property: Defines the source of the SSL certificate. + * + * @param certificateType the certificateType value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withCertificateType(AfdCertificateType certificateType) { + this.certificateType = certificateType; + return this; + } + + /** + * Get the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @return the minimumTlsVersion value. + */ + public AfdMinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withMinimumTlsVersion(AfdMinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the secret property: Resource reference to the secret. ie. subs/rg/profile/secret. + * + * @return the secret value. + */ + public ResourceReference secret() { + return this.secret; + } + + /** + * Set the secret property: Resource reference to the secret. ie. subs/rg/profile/secret. + * + * @param secret the secret value to set. + * @return the AfdDomainHttpsParameters object itself. + */ + public AfdDomainHttpsParameters withSecret(ResourceReference secret) { + this.secret = secret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateType in model AfdDomainHttpsParameters")); + } + if (secret() != null) { + secret().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdDomainHttpsParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainListResult.java new file mode 100644 index 0000000000000..8ce494137141e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list domains. It contains a list of domain objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class AfdDomainListResult { + /* + * List of AzureFrontDoor domains within a profile. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of domain objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AfdDomainListResult class. */ + public AfdDomainListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor domains within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdDomainListResult object itself. + */ + public AfdDomainListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.java new file mode 100644 index 0000000000000..f752cf7695716 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The domain JSON object required for domain creation or update. */ +@Fluent +public final class AfdDomainUpdateParameters { + /* + * The JSON object that contains the properties of the domain to create. + */ + @JsonProperty(value = "properties") + private AfdDomainUpdatePropertiesParameters innerProperties; + + /** Creates an instance of AfdDomainUpdateParameters class. */ + public AfdDomainUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private AfdDomainUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the domain. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @return the tlsSettings value. + */ + public AfdDomainHttpsParameters tlsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tlsSettings(); + } + + /** + * Set the tlsSettings property: The configuration specifying how to enable HTTPS for the domain - using + * AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor + * managed certificate by default. + * + * @param tlsSettings the tlsSettings value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withTlsSettings(AfdDomainHttpsParameters tlsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withTlsSettings(tlsSettings); + return this; + } + + /** + * Get the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @return the azureDnsZone value. + */ + public ResourceReference azureDnsZone() { + return this.innerProperties() == null ? null : this.innerProperties().azureDnsZone(); + } + + /** + * Set the azureDnsZone property: Resource reference to the Azure DNS zone. + * + * @param azureDnsZone the azureDnsZone value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withAzureDnsZone(ResourceReference azureDnsZone) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withAzureDnsZone(azureDnsZone); + return this; + } + + /** + * Get the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @return the preValidatedCustomDomainResourceId value. + */ + public ResourceReference preValidatedCustomDomainResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().preValidatedCustomDomainResourceId(); + } + + /** + * Set the preValidatedCustomDomainResourceId property: Resource reference to the Azure resource where custom domain + * ownership was prevalidated. + * + * @param preValidatedCustomDomainResourceId the preValidatedCustomDomainResourceId value to set. + * @return the AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withPreValidatedCustomDomainResourceId( + ResourceReference preValidatedCustomDomainResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdDomainUpdatePropertiesParameters(); + } + this.innerProperties().withPreValidatedCustomDomainResourceId(preValidatedCustomDomainResourceId); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.java new file mode 100644 index 0000000000000..c9b69fb77e094 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import java.util.Map; + +/** An immutable client-side representation of AfdEndpoint. */ +public interface AfdEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value + * is TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * 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.cdn.generated.fluent.models.AfdEndpointInner object. + * + * @return the inner object. + */ + AfdEndpointInner innerModel(); + + /** The entirety of the AfdEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The AfdEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the AfdEndpoint definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AfdEndpoint definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the AfdEndpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the AfdEndpoint 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.WithAutoGeneratedDomainNameLabelScope, + DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdEndpoint create(Context context); + } + /** The stage of the AfdEndpoint 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 AfdEndpoint definition allowing to specify autoGeneratedDomainNameLabelScope. */ + interface WithAutoGeneratedDomainNameLabelScope { + /** + * Specifies the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The + * default value is TenantReuse.. + * + * @param autoGeneratedDomainNameLabelScope Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * @return the next definition stage. + */ + WithCreate withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope); + } + /** The stage of the AfdEndpoint definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + } + /** + * Begins update for the AfdEndpoint resource. + * + * @return the stage of resource update. + */ + AfdEndpoint.Update update(); + + /** The template for AfdEndpoint update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdEndpoint apply(Context context); + } + /** The AfdEndpoint update stages. */ + interface UpdateStages { + /** The stage of the AfdEndpoint update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Endpoint tags.. + * + * @param tags Endpoint tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the AfdEndpoint update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdEndpoint refresh(Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent(AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @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 purgeContent(AfdPurgeParameters contents, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java new file mode 100644 index 0000000000000..acb00b5611e1a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class AfdEndpointListResult { + /* + * List of AzureFrontDoor endpoints within a profile + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of endpoint objects if there is any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AfdEndpointListResult class. */ + public AfdEndpointListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor endpoints within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the AfdEndpointListResult object itself. + */ + public AfdEndpointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.java new file mode 100644 index 0000000000000..f3a79303637b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Supported protocols for the customer's endpoint. */ +public final class AfdEndpointProtocols extends ExpandableStringEnum { + /** Static value Http for AfdEndpointProtocols. */ + public static final AfdEndpointProtocols HTTP = fromString("Http"); + + /** Static value Https for AfdEndpointProtocols. */ + public static final AfdEndpointProtocols HTTPS = fromString("Https"); + + /** + * Creates or finds a AfdEndpointProtocols from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdEndpointProtocols. + */ + @JsonCreator + public static AfdEndpointProtocols fromString(String name) { + return fromString(name, AfdEndpointProtocols.class); + } + + /** + * Gets known AfdEndpointProtocols values. + * + * @return known AfdEndpointProtocols values. + */ + public static Collection values() { + return values(AfdEndpointProtocols.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java new file mode 100644 index 0000000000000..03c4834b8ba48 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to create or update an endpoint. */ +@Fluent +public final class AfdEndpointUpdateParameters { + /* + * Endpoint tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The JSON object containing endpoint update parameters. + */ + @JsonProperty(value = "properties") + private AfdEndpointPropertiesUpdateParameters innerProperties; + + /** Creates an instance of AfdEndpointUpdateParameters class. */ + public AfdEndpointUpdateParameters() { + } + + /** + * Get the tags property: Endpoint tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Endpoint tags. + * + * @param tags the tags value to set. + * @return the AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing endpoint update parameters. + * + * @return the innerProperties value. + */ + private AfdEndpointPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the endpoint. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdEndpointPropertiesUpdateParameters(); + } + this.innerProperties().withEnabledState(enabledState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java new file mode 100644 index 0000000000000..586499c090912 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 AfdEndpoints. */ +public interface AfdEndpoints { + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + AfdEndpoint get(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent(String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full + * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + * '/pictures/*' which removes all folders and files in the directory. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + AfdPurgeParameters contents, + Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @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 an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + AfdEndpoint getById(String id); + + /** + * Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @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 an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @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 an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new AfdEndpoint definition. + */ + AfdEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.java new file mode 100644 index 0000000000000..a722536b5d4f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** TLS protocol version that will be used for Https. */ +public enum AfdMinimumTlsVersion { + /** Enum value TLS10. */ + TLS10("TLS10"), + + /** Enum value TLS12. */ + TLS12("TLS12"); + + /** The actual serialized value for a AfdMinimumTlsVersion instance. */ + private final String value; + + AfdMinimumTlsVersion(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AfdMinimumTlsVersion instance. + * + * @param value the serialized value to parse. + * @return the parsed AfdMinimumTlsVersion object, or null if unable to parse. + */ + @JsonCreator + public static AfdMinimumTlsVersion fromString(String value) { + if (value == null) { + return null; + } + AfdMinimumTlsVersion[] items = AfdMinimumTlsVersion.values(); + for (AfdMinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java new file mode 100644 index 0000000000000..8b54e97aa1583 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; + +/** An immutable client-side representation of AfdOrigin. */ +public interface AfdOrigin { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + String originGroupName(); + + /** + * Gets the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + ResourceReference azureOrigin(); + + /** + * Gets the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + Integer httpPort(); + + /** + * Gets the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + Integer httpsPort(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + Integer weight(); + + /** + * Gets the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + SharedPrivateLinkResourceProperties sharedPrivateLinkResource(); + + /** + * Gets the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * Gets the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + Boolean enforceCertificateNameCheck(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner object. + * + * @return the inner object. + */ + AfdOriginInner innerModel(); + + /** The entirety of the AfdOrigin definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AfdOrigin definition stages. */ + interface DefinitionStages { + /** The first stage of the AfdOrigin definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AfdOrigin definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, originGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @return the next definition stage. + */ + WithCreate withExistingOriginGroup(String resourceGroupName, String profileName, String originGroupName); + } + /** + * The stage of the AfdOrigin 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.WithAzureOrigin, + DefinitionStages.WithHostname, + DefinitionStages.WithHttpPort, + DefinitionStages.WithHttpsPort, + DefinitionStages.WithOriginHostHeader, + DefinitionStages.WithPriority, + DefinitionStages.WithWeight, + DefinitionStages.WithSharedPrivateLinkResource, + DefinitionStages.WithEnabledState, + DefinitionStages.WithEnforceCertificateNameCheck { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdOrigin create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdOrigin create(Context context); + } + /** The stage of the AfdOrigin definition allowing to specify azureOrigin. */ + interface WithAzureOrigin { + /** + * Specifies the azureOrigin property: Resource reference to the Azure origin resource.. + * + * @param azureOrigin Resource reference to the Azure origin resource. + * @return the next definition stage. + */ + WithCreate withAzureOrigin(ResourceReference azureOrigin); + } + /** The stage of the AfdOrigin definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + /** The stage of the AfdOrigin definition allowing to specify httpPort. */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpPort(Integer httpPort); + } + /** The stage of the AfdOrigin definition allowing to specify httpsPort. */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpsPort(Integer httpsPort); + } + /** The stage of the AfdOrigin definition allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web + * Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by + * default. This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob + * Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + /** The stage of the AfdOrigin definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the AfdOrigin definition allowing to specify weight. */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + WithCreate withWeight(Integer weight); + } + /** The stage of the AfdOrigin definition allowing to specify sharedPrivateLinkResource. */ + interface WithSharedPrivateLinkResource { + /** + * Specifies the sharedPrivateLinkResource property: The properties of the private link resource for private + * origin.. + * + * @param sharedPrivateLinkResource The properties of the private link resource for private origin. + * @return the next definition stage. + */ + WithCreate withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource); + } + /** The stage of the AfdOrigin definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool.. + * + * @param enabledState Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + /** The stage of the AfdOrigin definition allowing to specify enforceCertificateNameCheck. */ + interface WithEnforceCertificateNameCheck { + /** + * Specifies the enforceCertificateNameCheck property: Whether to enable certificate name check at origin + * level. + * + * @param enforceCertificateNameCheck Whether to enable certificate name check at origin level. + * @return the next definition stage. + */ + WithCreate withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck); + } + } + /** + * Begins update for the AfdOrigin resource. + * + * @return the stage of resource update. + */ + AfdOrigin.Update update(); + + /** The template for AfdOrigin update. */ + interface Update + extends UpdateStages.WithAzureOrigin, + UpdateStages.WithHostname, + UpdateStages.WithHttpPort, + UpdateStages.WithHttpsPort, + UpdateStages.WithOriginHostHeader, + UpdateStages.WithPriority, + UpdateStages.WithWeight, + UpdateStages.WithSharedPrivateLinkResource, + UpdateStages.WithEnabledState, + UpdateStages.WithEnforceCertificateNameCheck { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdOrigin apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdOrigin apply(Context context); + } + /** The AfdOrigin update stages. */ + interface UpdateStages { + /** The stage of the AfdOrigin update allowing to specify azureOrigin. */ + interface WithAzureOrigin { + /** + * Specifies the azureOrigin property: Resource reference to the Azure origin resource.. + * + * @param azureOrigin Resource reference to the Azure origin resource. + * @return the next definition stage. + */ + Update withAzureOrigin(ResourceReference azureOrigin); + } + /** The stage of the AfdOrigin update allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + /** The stage of the AfdOrigin update allowing to specify httpPort. */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpPort(Integer httpPort); + } + /** The stage of the AfdOrigin update allowing to specify httpsPort. */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpsPort(Integer httpsPort); + } + /** The stage of the AfdOrigin update allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web + * Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by + * default. This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob + * Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + /** The stage of the AfdOrigin update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the AfdOrigin update allowing to specify weight. */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + Update withWeight(Integer weight); + } + /** The stage of the AfdOrigin update allowing to specify sharedPrivateLinkResource. */ + interface WithSharedPrivateLinkResource { + /** + * Specifies the sharedPrivateLinkResource property: The properties of the private link resource for private + * origin.. + * + * @param sharedPrivateLinkResource The properties of the private link resource for private origin. + * @return the next definition stage. + */ + Update withSharedPrivateLinkResource(SharedPrivateLinkResourceProperties sharedPrivateLinkResource); + } + /** The stage of the AfdOrigin update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable health probes to be made against backends defined + * under backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool.. + * + * @param enabledState Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single + * enabled backend pool. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + /** The stage of the AfdOrigin update allowing to specify enforceCertificateNameCheck. */ + interface WithEnforceCertificateNameCheck { + /** + * Specifies the enforceCertificateNameCheck property: Whether to enable certificate name check at origin + * level. + * + * @param enforceCertificateNameCheck Whether to enable certificate name check at origin level. + * @return the next definition stage. + */ + Update withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdOrigin refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdOrigin refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java new file mode 100644 index 0000000000000..5a090458b54b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; + +/** An immutable client-side representation of AfdOriginGroup. */ +public interface AfdOriginGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + LoadBalancingSettingsParameters loadBalancingSettings(); + + /** + * Gets the healthProbeSettings property: Health probe settings to the origin that is used to determine the health + * of the origin. + * + * @return the healthProbeSettings value. + */ + HealthProbeParameters healthProbeSettings(); + + /** + * Gets the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + + /** + * Gets the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + EnabledState sessionAffinityState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner object. + * + * @return the inner object. + */ + AfdOriginGroupInner innerModel(); + + /** The entirety of the AfdOriginGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AfdOriginGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the AfdOriginGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AfdOriginGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the AfdOriginGroup 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.WithLoadBalancingSettings, + DefinitionStages.WithHealthProbeSettings, + DefinitionStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + DefinitionStages.WithSessionAffinityState { + /** + * Executes the create request. + * + * @return the created resource. + */ + AfdOriginGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AfdOriginGroup create(Context context); + } + /** The stage of the AfdOriginGroup definition allowing to specify loadBalancingSettings. */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings Load balancing settings for a backend pool. + * @return the next definition stage. + */ + WithCreate withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings); + } + /** The stage of the AfdOriginGroup definition allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + WithCreate withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + /** + * The stage of the AfdOriginGroup definition allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + /** The stage of the AfdOriginGroup definition allowing to specify sessionAffinityState. */ + interface WithSessionAffinityState { + /** + * Specifies the sessionAffinityState property: Whether to allow session affinity on this host. Valid + * options are 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withSessionAffinityState(EnabledState sessionAffinityState); + } + } + /** + * Begins update for the AfdOriginGroup resource. + * + * @return the stage of resource update. + */ + AfdOriginGroup.Update update(); + + /** The template for AfdOriginGroup update. */ + interface Update + extends UpdateStages.WithLoadBalancingSettings, + UpdateStages.WithHealthProbeSettings, + UpdateStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + UpdateStages.WithSessionAffinityState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AfdOriginGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AfdOriginGroup apply(Context context); + } + /** The AfdOriginGroup update stages. */ + interface UpdateStages { + /** The stage of the AfdOriginGroup update allowing to specify loadBalancingSettings. */ + interface WithLoadBalancingSettings { + /** + * Specifies the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings Load balancing settings for a backend pool. + * @return the next definition stage. + */ + Update withLoadBalancingSettings(LoadBalancingSettingsParameters loadBalancingSettings); + } + /** The stage of the AfdOriginGroup update allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + Update withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + /** + * The stage of the AfdOriginGroup update allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + Update withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + /** The stage of the AfdOriginGroup update allowing to specify sessionAffinityState. */ + interface WithSessionAffinityState { + /** + * Specifies the sessionAffinityState property: Whether to allow session affinity on this host. Valid + * options are 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState Whether to allow session affinity on this host. Valid options are 'Enabled' + * or 'Disabled'. + * @return the next definition stage. + */ + Update withSessionAffinityState(EnabledState sessionAffinityState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AfdOriginGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AfdOriginGroup refresh(Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java new file mode 100644 index 0000000000000..79b1e052ff632 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the + * next set of results. + */ +@Fluent +public final class AfdOriginGroupListResult { + /* + * List of Azure Front Door origin groups within an Azure Front Door endpoint + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AfdOriginGroupListResult class. */ + public AfdOriginGroupListResult() { + } + + /** + * Get the value property: List of Azure Front Door origin groups within an Azure Front Door endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdOriginGroupListResult object itself. + */ + public AfdOriginGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.java new file mode 100644 index 0000000000000..30bf8e0e4586d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AFDOrigin group properties needed for origin group creation or update. */ +@Fluent +public final class AfdOriginGroupUpdateParameters { + /* + * The JSON object that contains the properties of the origin group. + */ + @JsonProperty(value = "properties") + private AfdOriginGroupUpdatePropertiesParameters innerProperties; + + /** Creates an instance of AfdOriginGroupUpdateParameters class. */ + public AfdOriginGroupUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private AfdOriginGroupUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the profileName property: The name of the profile which holds the origin group. + * + * @return the profileName value. + */ + public String profileName() { + return this.innerProperties() == null ? null : this.innerProperties().profileName(); + } + + /** + * Get the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @return the loadBalancingSettings value. + */ + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancingSettings(); + } + + /** + * Set the loadBalancingSettings property: Load balancing settings for a backend pool. + * + * @param loadBalancingSettings the loadBalancingSettings value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withLoadBalancingSettings( + LoadBalancingSettingsParameters loadBalancingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withLoadBalancingSettings(loadBalancingSettings); + return this; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this + .innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @return the sessionAffinityState value. + */ + public EnabledState sessionAffinityState() { + return this.innerProperties() == null ? null : this.innerProperties().sessionAffinityState(); + } + + /** + * Set the sessionAffinityState property: Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled'. + * + * @param sessionAffinityState the sessionAffinityState value to set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withSessionAffinityState(EnabledState sessionAffinityState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withSessionAffinityState(sessionAffinityState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.java new file mode 100644 index 0000000000000..7e0f5cd7caef4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 AfdOriginGroups. */ +public interface AfdOriginGroups { + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists all of the existing origin groups within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 an existing origin group within a profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within a profile. + */ + AfdOriginGroup get(String resourceGroupName, String profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String originGroupName); + + /** + * Deletes an existing origin group within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @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 profileName, String originGroupName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Gets an existing origin group within a profile. + * + * @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 an existing origin group within a profile along with {@link Response}. + */ + AfdOriginGroup getById(String id); + + /** + * Gets an existing origin group within a profile. + * + * @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 an existing origin group within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin group within a profile. + * + * @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 an existing origin group within a profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdOriginGroup resource. + * + * @param name resource name. + * @return the first stage of the new AfdOriginGroup definition. + */ + AfdOriginGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java new file mode 100644 index 0000000000000..fc52d8724a475 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class AfdOriginListResult { + /* + * List of Azure Front Door origins within an Azure Front Door endpoint + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AfdOriginListResult class. */ + public AfdOriginListResult() { + } + + /** + * Get the value property: List of Azure Front Door origins within an Azure Front Door endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AfdOriginListResult object itself. + */ + public AfdOriginListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.java new file mode 100644 index 0000000000000..d4d25e3b25291 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AFDOrigin properties needed for origin update. */ +@Fluent +public final class AfdOriginUpdateParameters { + /* + * The JSON object that contains the properties of the origin. + */ + @JsonProperty(value = "properties") + private AfdOriginUpdatePropertiesParameters innerProperties; + + /** Creates an instance of AfdOriginUpdateParameters class. */ + public AfdOriginUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private AfdOriginUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originGroupName property: The name of the origin group which contains this origin. + * + * @return the originGroupName value. + */ + public String originGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().originGroupName(); + } + + /** + * Get the azureOrigin property: Resource reference to the Azure origin resource. + * + * @return the azureOrigin value. + */ + public ResourceReference azureOrigin() { + return this.innerProperties() == null ? null : this.innerProperties().azureOrigin(); + } + + /** + * Set the azureOrigin property: Resource reference to the Azure origin resource. + * + * @param azureOrigin the azureOrigin value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withAzureOrigin(ResourceReference azureOrigin) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withAzureOrigin(azureOrigin); + return this; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and + * Cloud Services require this host header value to match the origin hostname by default. This overrides the host + * header defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + public SharedPrivateLinkResourceProperties sharedPrivateLinkResource() { + return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResource(); + } + + /** + * Set the sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @param sharedPrivateLinkResource the sharedPrivateLinkResource value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withSharedPrivateLinkResource( + SharedPrivateLinkResourceProperties sharedPrivateLinkResource) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** + * Get the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable health probes to be made against backends defined under + * backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend + * pool. + * + * @param enabledState the enabledState value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Get the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @return the enforceCertificateNameCheck value. + */ + public Boolean enforceCertificateNameCheck() { + return this.innerProperties() == null ? null : this.innerProperties().enforceCertificateNameCheck(); + } + + /** + * Set the enforceCertificateNameCheck property: Whether to enable certificate name check at origin level. + * + * @param enforceCertificateNameCheck the enforceCertificateNameCheck value to set. + * @return the AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withEnforceCertificateNameCheck(Boolean enforceCertificateNameCheck) { + if (this.innerProperties() == null) { + this.innerProperties = new AfdOriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnforceCertificateNameCheck(enforceCertificateNameCheck); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.java new file mode 100644 index 0000000000000..c07339cca01f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 AfdOrigins. */ +public interface AfdOrigins { + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOriginGroup(String resourceGroupName, String profileName, String originGroupName); + + /** + * Lists all of the existing origins within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOriginGroup( + String resourceGroupName, String profileName, String originGroupName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @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 an existing origin within an origin group along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, String originName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an origin group. + */ + AfdOrigin get(String resourceGroupName, String profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String originGroupName, String originName); + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param originGroupName Name of the origin group which is unique within the profile. + * @param originName Name of the origin which is unique within the profile. + * @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 profileName, String originGroupName, String originName, Context context); + + /** + * Gets an existing origin within an origin group. + * + * @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 an existing origin within an origin group along with {@link Response}. + */ + AfdOrigin getById(String id); + + /** + * Gets an existing origin within an origin group. + * + * @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 an existing origin within an origin group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin within an origin group. + * + * @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 an existing origin within an origin group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AfdOrigin resource. + * + * @param name resource name. + * @return the first stage of the new AfdOrigin definition. + */ + AfdOrigin.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.java new file mode 100644 index 0000000000000..cb8f08d4bc2c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.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.cdn.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 AfdProfiles. */ +public interface AfdProfiles { + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @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 output of check name availability API along with {@link Response}. + */ + Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + CheckHostnameAvailabilityInput checkHostnameAvailabilityInput, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param checkHostnameAvailabilityInput Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput checkHostnameAvailability( + String resourceGroupName, String profileName, CheckHostnameAvailabilityInput checkHostnameAvailabilityInput); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @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 output of the validated secret along with {@link Response}. + */ + Response validateSecretWithResponse( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput, Context context); + + /** + * Validate a Secret in the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param validateSecretInput The Secret source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validated secret. + */ + ValidateSecretOutput validateSecret( + String resourceGroupName, String profileName, ValidateSecretInput validateSecretInput); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + Profile upgrade(String resourceGroupName, String profileName, ProfileUpgradeParameters profileUpgradeParameters); + + /** + * Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the + * resource group. + * @param profileUpgradeParameters Profile upgrade input parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a profile is a logical grouping of endpoints that share the same settings. + */ + Profile upgrade( + String resourceGroupName, + String profileName, + ProfileUpgradeParameters profileUpgradeParameters, + Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java new file mode 100644 index 0000000000000..4019fb64e6a4f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status. */ +public final class AfdProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AfdProvisioningState. */ + public static final AfdProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AfdProvisioningState. */ + public static final AfdProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for AfdProvisioningState. */ + public static final AfdProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for AfdProvisioningState. */ + public static final AfdProvisioningState DELETING = fromString("Deleting"); + + /** Static value Creating for AfdProvisioningState. */ + public static final AfdProvisioningState CREATING = fromString("Creating"); + + /** + * Creates or finds a AfdProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdProvisioningState. + */ + @JsonCreator + public static AfdProvisioningState fromString(String name) { + return fromString(name, AfdProvisioningState.class); + } + + /** + * Gets known AfdProvisioningState values. + * + * @return known AfdProvisioningState values. + */ + public static Collection values() { + return values(AfdProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java new file mode 100644 index 0000000000000..33348ad2650a3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content purge. */ +@Fluent +public final class AfdPurgeParameters { + /* + * The path to the content to be purged. Can describe a file path or a wild card directory. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /* + * List of domains. + */ + @JsonProperty(value = "domains") + private List domains; + + /** Creates an instance of AfdPurgeParameters class. */ + public AfdPurgeParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @param contentPaths the contentPaths value to set. + * @return the AfdPurgeParameters object itself. + */ + public AfdPurgeParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Get the domains property: List of domains. + * + * @return the domains value. + */ + public List domains() { + return this.domains; + } + + /** + * Set the domains property: List of domains. + * + * @param domains the domains value to set. + * @return the AfdPurgeParameters object itself. + */ + public AfdPurgeParameters withDomains(List domains) { + this.domains = domains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property contentPaths in model AfdPurgeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AfdPurgeParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.java new file mode 100644 index 0000000000000..6bdfd218ca3da --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ +public final class AfdQueryStringCachingBehavior extends ExpandableStringEnum { + /** Static value IgnoreQueryString for AfdQueryStringCachingBehavior. */ + public static final AfdQueryStringCachingBehavior IGNORE_QUERY_STRING = fromString("IgnoreQueryString"); + + /** Static value UseQueryString for AfdQueryStringCachingBehavior. */ + public static final AfdQueryStringCachingBehavior USE_QUERY_STRING = fromString("UseQueryString"); + + /** Static value IgnoreSpecifiedQueryStrings for AfdQueryStringCachingBehavior. */ + public static final AfdQueryStringCachingBehavior IGNORE_SPECIFIED_QUERY_STRINGS = + fromString("IgnoreSpecifiedQueryStrings"); + + /** Static value IncludeSpecifiedQueryStrings for AfdQueryStringCachingBehavior. */ + public static final AfdQueryStringCachingBehavior INCLUDE_SPECIFIED_QUERY_STRINGS = + fromString("IncludeSpecifiedQueryStrings"); + + /** + * Creates or finds a AfdQueryStringCachingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding AfdQueryStringCachingBehavior. + */ + @JsonCreator + public static AfdQueryStringCachingBehavior fromString(String name) { + return fromString(name, AfdQueryStringCachingBehavior.class); + } + + /** + * Gets known AfdQueryStringCachingBehavior values. + * + * @return known AfdQueryStringCachingBehavior values. + */ + public static Collection values() { + return values(AfdQueryStringCachingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java new file mode 100644 index 0000000000000..6d042f420d69b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdRouteCacheConfiguration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object. */ +@Fluent +public final class AfdRouteCacheConfiguration { + /* + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ + @JsonProperty(value = "queryStringCachingBehavior") + private AfdQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + @JsonProperty(value = "queryParameters") + private String queryParameters; + + /* + * compression settings. + */ + @JsonProperty(value = "compressionSettings") + private CompressionSettings compressionSettings; + + /** Creates an instance of AfdRouteCacheConfiguration class. */ + public AfdRouteCacheConfiguration() { + } + + /** + * Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @return the queryStringCachingBehavior value. + */ + public AfdQueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration withQueryStringCachingBehavior( + AfdQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the queryParameters property: query parameters to include or exclude (comma separated). + * + * @return the queryParameters value. + */ + public String queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: query parameters to include or exclude (comma separated). + * + * @param queryParameters the queryParameters value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration withQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + public CompressionSettings compressionSettings() { + return this.compressionSettings; + } + + /** + * Set the compressionSettings property: compression settings. + * + * @param compressionSettings the compressionSettings value to set. + * @return the AfdRouteCacheConfiguration object itself. + */ + public AfdRouteCacheConfiguration withCompressionSettings(CompressionSettings compressionSettings) { + this.compressionSettings = compressionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (compressionSettings() != null) { + compressionSettings().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdStateProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdStateProperties.java new file mode 100644 index 0000000000000..ebde90b9b0662 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdStateProperties.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The tracking states for afd resources. */ +@Immutable +public class AfdStateProperties { + /* + * Provisioning status + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /** Creates an instance of AfdStateProperties class. */ + public AfdStateProperties() { + } + + /** + * Get the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + public AfdProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.java new file mode 100644 index 0000000000000..6641e337edb7b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Algorithm to use for URL signing. */ +public final class Algorithm extends ExpandableStringEnum { + /** Static value SHA256 for Algorithm. */ + public static final Algorithm SHA256 = fromString("SHA256"); + + /** + * Creates or finds a Algorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding Algorithm. + */ + @JsonCreator + public static Algorithm fromString(String name) { + return fromString(name, Algorithm.class); + } + + /** + * Gets known Algorithm values. + * + * @return known Algorithm values. + */ + public static Collection values() { + return values(Algorithm.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.java new file mode 100644 index 0000000000000..f6770a7a3932a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AutoGeneratedDomainNameLabelScope.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates the endpoint name reuse scope. The default value is TenantReuse. */ +public final class AutoGeneratedDomainNameLabelScope extends ExpandableStringEnum { + /** Static value TenantReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope TENANT_REUSE = fromString("TenantReuse"); + + /** Static value SubscriptionReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** Static value ResourceGroupReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** Static value NoReuse for AutoGeneratedDomainNameLabelScope. */ + public static final AutoGeneratedDomainNameLabelScope NO_REUSE = fromString("NoReuse"); + + /** + * Creates or finds a AutoGeneratedDomainNameLabelScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoGeneratedDomainNameLabelScope. + */ + @JsonCreator + public static AutoGeneratedDomainNameLabelScope fromString(String name) { + return fromString(name, AutoGeneratedDomainNameLabelScope.class); + } + + /** + * Gets known AutoGeneratedDomainNameLabelScope values. + * + * @return known AutoGeneratedDomainNameLabelScope values. + */ + public static Collection values() { + return values(AutoGeneratedDomainNameLabelScope.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java new file mode 100644 index 0000000000000..5af1fb76f31e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificate.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; + +/** Azure FirstParty Managed Certificate provided by other first party resource providers to enable HTTPS. */ +@Fluent +public final class AzureFirstPartyManagedCertificate extends Certificate { + /** Creates an instance of AzureFirstPartyManagedCertificate class. */ + public AzureFirstPartyManagedCertificate() { + } + + /** {@inheritDoc} */ + @Override + public AzureFirstPartyManagedCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.java new file mode 100644 index 0000000000000..f06bd7ffd33da --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AzureFirstPartyManagedCertificateParameters.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure FirstParty Managed Certificate provided by other first party resource providers to enable HTTPS. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("AzureFirstPartyManagedCertificate") +@Immutable +public final class AzureFirstPartyManagedCertificateParameters extends SecretParameters { + /** Creates an instance of AzureFirstPartyManagedCertificateParameters class. */ + public AzureFirstPartyManagedCertificateParameters() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.java new file mode 100644 index 0000000000000..08a3fbee8a7f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Caching behavior for the requests. */ +public final class CacheBehavior extends ExpandableStringEnum { + /** Static value BypassCache for CacheBehavior. */ + public static final CacheBehavior BYPASS_CACHE = fromString("BypassCache"); + + /** Static value Override for CacheBehavior. */ + public static final CacheBehavior OVERRIDE = fromString("Override"); + + /** Static value SetIfMissing for CacheBehavior. */ + public static final CacheBehavior SET_IF_MISSING = fromString("SetIfMissing"); + + /** + * Creates or finds a CacheBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheBehavior. + */ + @JsonCreator + public static CacheBehavior fromString(String name) { + return fromString(name, CacheBehavior.class); + } + + /** + * Gets known CacheBehavior values. + * + * @return known CacheBehavior values. + */ + public static Collection values() { + return values(CacheBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.java new file mode 100644 index 0000000000000..6f0b3c987a2ce --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheConfiguration.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object. */ +@Fluent +public final class CacheConfiguration { + /* + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ + @JsonProperty(value = "queryStringCachingBehavior") + private RuleQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + @JsonProperty(value = "queryParameters") + private String queryParameters; + + /* + * Indicates whether content compression is enabled. If compression is enabled, content will be served as + * compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when + * requested content is smaller than 1 byte or larger than 1 MB. + */ + @JsonProperty(value = "isCompressionEnabled") + private RuleIsCompressionEnabled isCompressionEnabled; + + /* + * Caching behavior for the requests + */ + @JsonProperty(value = "cacheBehavior") + private RuleCacheBehavior cacheBehavior; + + /* + * The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss + */ + @JsonProperty(value = "cacheDuration") + private String cacheDuration; + + /** Creates an instance of CacheConfiguration class. */ + public CacheConfiguration() { + } + + /** + * Get the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @return the queryStringCachingBehavior value. + */ + public RuleQueryStringCachingBehavior queryStringCachingBehavior() { + return this.queryStringCachingBehavior; + } + + /** + * Set the queryStringCachingBehavior property: Defines how Frontdoor caches requests that include query strings. + * You can ignore any query strings when caching, ignore specific query strings, cache every request with a unique + * URL, or cache specific query strings. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withQueryStringCachingBehavior( + RuleQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + return this; + } + + /** + * Get the queryParameters property: query parameters to include or exclude (comma separated). + * + * @return the queryParameters value. + */ + public String queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: query parameters to include or exclude (comma separated). + * + * @param queryParameters the queryParameters value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public RuleIsCompressionEnabled isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withIsCompressionEnabled(RuleIsCompressionEnabled isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Get the cacheBehavior property: Caching behavior for the requests. + * + * @return the cacheBehavior value. + */ + public RuleCacheBehavior cacheBehavior() { + return this.cacheBehavior; + } + + /** + * Set the cacheBehavior property: Caching behavior for the requests. + * + * @param cacheBehavior the cacheBehavior value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withCacheBehavior(RuleCacheBehavior cacheBehavior) { + this.cacheBehavior = cacheBehavior; + return this; + } + + /** + * Get the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @return the cacheDuration value. + */ + public String cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @param cacheDuration the cacheDuration value to set. + * @return the CacheConfiguration object itself. + */ + public CacheConfiguration withCacheDuration(String cacheDuration) { + this.cacheDuration = cacheDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.java new file mode 100644 index 0000000000000..12e8b4d1a0142 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the cache expiration action. */ +@Fluent +public final class CacheExpirationActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleCacheExpirationActionParameters"; + + /* + * Caching behavior for the requests + */ + @JsonProperty(value = "cacheBehavior", required = true) + private CacheBehavior cacheBehavior; + + /* + * The level at which the content needs to be cached. + */ + @JsonProperty(value = "cacheType", required = true) + private CacheType cacheType; + + /* + * The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss + */ + @JsonProperty(value = "cacheDuration") + private String cacheDuration; + + /** Creates an instance of CacheExpirationActionParameters class. */ + public CacheExpirationActionParameters() { + typeName = "DeliveryRuleCacheExpirationActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the cacheBehavior property: Caching behavior for the requests. + * + * @return the cacheBehavior value. + */ + public CacheBehavior cacheBehavior() { + return this.cacheBehavior; + } + + /** + * Set the cacheBehavior property: Caching behavior for the requests. + * + * @param cacheBehavior the cacheBehavior value to set. + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheBehavior(CacheBehavior cacheBehavior) { + this.cacheBehavior = cacheBehavior; + return this; + } + + /** + * Get the cacheType property: The level at which the content needs to be cached. + * + * @return the cacheType value. + */ + public CacheType cacheType() { + return this.cacheType; + } + + /** + * Set the cacheType property: The level at which the content needs to be cached. + * + * @param cacheType the cacheType value to set. + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheType(CacheType cacheType) { + this.cacheType = cacheType; + return this; + } + + /** + * Get the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @return the cacheDuration value. + */ + public String cacheDuration() { + return this.cacheDuration; + } + + /** + * Set the cacheDuration property: The duration for which the content needs to be cached. Allowed format is + * [d.]hh:mm:ss. + * + * @param cacheDuration the cacheDuration value to set. + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withCacheDuration(String cacheDuration) { + this.cacheDuration = cacheDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cacheBehavior() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property cacheBehavior in model CacheExpirationActionParameters")); + } + if (cacheType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property cacheType in model CacheExpirationActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CacheExpirationActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.java new file mode 100644 index 0000000000000..953df557e9b25 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the cache-key query string action. */ +@Fluent +public final class CacheKeyQueryStringActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"; + + /* + * Caching behavior for the requests + */ + @JsonProperty(value = "queryStringBehavior", required = true) + private QueryStringBehavior queryStringBehavior; + + /* + * query parameters to include or exclude (comma separated). + */ + @JsonProperty(value = "queryParameters") + private String queryParameters; + + /** Creates an instance of CacheKeyQueryStringActionParameters class. */ + public CacheKeyQueryStringActionParameters() { + typeName = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the CacheKeyQueryStringActionParameters object itself. + */ + public CacheKeyQueryStringActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the queryStringBehavior property: Caching behavior for the requests. + * + * @return the queryStringBehavior value. + */ + public QueryStringBehavior queryStringBehavior() { + return this.queryStringBehavior; + } + + /** + * Set the queryStringBehavior property: Caching behavior for the requests. + * + * @param queryStringBehavior the queryStringBehavior value to set. + * @return the CacheKeyQueryStringActionParameters object itself. + */ + public CacheKeyQueryStringActionParameters withQueryStringBehavior(QueryStringBehavior queryStringBehavior) { + this.queryStringBehavior = queryStringBehavior; + return this; + } + + /** + * Get the queryParameters property: query parameters to include or exclude (comma separated). + * + * @return the queryParameters value. + */ + public String queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: query parameters to include or exclude (comma separated). + * + * @param queryParameters the queryParameters value to set. + * @return the CacheKeyQueryStringActionParameters object itself. + */ + public CacheKeyQueryStringActionParameters withQueryParameters(String queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryStringBehavior() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property queryStringBehavior in model CacheKeyQueryStringActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CacheKeyQueryStringActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.java new file mode 100644 index 0000000000000..41b2037242aea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The level at which the content needs to be cached. */ +public final class CacheType extends ExpandableStringEnum { + /** Static value All for CacheType. */ + public static final CacheType ALL = fromString("All"); + + /** + * Creates or finds a CacheType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheType. + */ + @JsonCreator + public static CacheType fromString(String name) { + return fromString(name, CacheType.class); + } + + /** + * Gets known CacheType values. + * + * @return known CacheType values. + */ + public static Collection values() { + return values(CacheType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.java new file mode 100644 index 0000000000000..10d327e82f0d1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateDefaultSku.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Recommended sku for the migration. */ +public final class CanMigrateDefaultSku extends ExpandableStringEnum { + /** Static value Standard_AzureFrontDoor for CanMigrateDefaultSku. */ + public static final CanMigrateDefaultSku STANDARD_AZURE_FRONT_DOOR = fromString("Standard_AzureFrontDoor"); + + /** Static value Premium_AzureFrontDoor for CanMigrateDefaultSku. */ + public static final CanMigrateDefaultSku PREMIUM_AZURE_FRONT_DOOR = fromString("Premium_AzureFrontDoor"); + + /** + * Creates or finds a CanMigrateDefaultSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding CanMigrateDefaultSku. + */ + @JsonCreator + public static CanMigrateDefaultSku fromString(String name) { + return fromString(name, CanMigrateDefaultSku.class); + } + + /** + * Gets known CanMigrateDefaultSku values. + * + * @return known CanMigrateDefaultSku values. + */ + public static Collection values() { + return values(CanMigrateDefaultSku.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java new file mode 100644 index 0000000000000..27c8b8d17d9a5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateParameters.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request body for CanMigrate operation. */ +@Fluent +public final class CanMigrateParameters { + /* + * Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + */ + @JsonProperty(value = "classicResourceReference", required = true) + private ResourceReference classicResourceReference; + + /** Creates an instance of CanMigrateParameters class. */ + public CanMigrateParameters() { + } + + /** + * Get the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @return the classicResourceReference value. + */ + public ResourceReference classicResourceReference() { + return this.classicResourceReference; + } + + /** + * Set the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @param classicResourceReference the classicResourceReference value to set. + * @return the CanMigrateParameters object itself. + */ + public CanMigrateParameters withClassicResourceReference(ResourceReference classicResourceReference) { + this.classicResourceReference = classicResourceReference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (classicResourceReference() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property classicResourceReference in model CanMigrateParameters")); + } else { + classicResourceReference().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CanMigrateParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.java new file mode 100644 index 0000000000000..6fc9d7c4795f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CanMigrateResult.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner; +import java.util.List; + +/** An immutable client-side representation of CanMigrateResult. */ +public interface CanMigrateResult { + /** + * Gets the canMigrate property: Flag that says if the profile can be migrated. + * + * @return the canMigrate value. + */ + Boolean canMigrate(); + + /** + * Gets the defaultSku property: Recommended sku for the migration. + * + * @return the defaultSku value. + */ + CanMigrateDefaultSku defaultSku(); + + /** + * Gets the errors property: The errors property. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CanMigrateResultInner object. + * + * @return the inner object. + */ + CanMigrateResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java new file mode 100644 index 0000000000000..eb4de23b5f094 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for using CDN managed certificate for securing custom domain. */ +@Fluent +public final class CdnCertificateSourceParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "CdnCertificateSourceParameters"; + + /* + * Type of certificate used + */ + @JsonProperty(value = "certificateType", required = true) + private CertificateType certificateType; + + /** Creates an instance of CdnCertificateSourceParameters class. */ + public CdnCertificateSourceParameters() { + typeName = "CdnCertificateSourceParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the CdnCertificateSourceParameters object itself. + */ + public CdnCertificateSourceParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the certificateType property: Type of certificate used. + * + * @return the certificateType value. + */ + public CertificateType certificateType() { + return this.certificateType; + } + + /** + * Set the certificateType property: Type of certificate used. + * + * @param certificateType the certificateType value to set. + * @return the CdnCertificateSourceParameters object itself. + */ + public CdnCertificateSourceParameters withCertificateType(CertificateType certificateType) { + this.certificateType = certificateType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateType in model CdnCertificateSourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnCertificateSourceParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnEndpoint.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnEndpoint.java new file mode 100644 index 0000000000000..2667b9e18f1cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnEndpoint.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the ARM Resource ID for the linked endpoints. */ +@Fluent +public final class CdnEndpoint { + /* + * ARM Resource ID string. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of CdnEndpoint class. */ + public CdnEndpoint() { + } + + /** + * Get the id property: ARM Resource ID string. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ARM Resource ID string. + * + * @param id the id value to set. + * @return the CdnEndpoint object itself. + */ + public CdnEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.java new file mode 100644 index 0000000000000..ae5345b81c941 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the certificate source parameters using CDN managed certificate for enabling SSL. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "certificateSource") +@JsonTypeName("Cdn") +@Fluent +public final class CdnManagedHttpsParameters extends CustomDomainHttpsParameters { + /* + * Defines the certificate source parameters using CDN managed certificate for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private CdnCertificateSourceParameters certificateSourceParameters; + + /** Creates an instance of CdnManagedHttpsParameters class. */ + public CdnManagedHttpsParameters() { + } + + /** + * Get the certificateSourceParameters property: Defines the certificate source parameters using CDN managed + * certificate for enabling SSL. + * + * @return the certificateSourceParameters value. + */ + public CdnCertificateSourceParameters certificateSourceParameters() { + return this.certificateSourceParameters; + } + + /** + * Set the certificateSourceParameters property: Defines the certificate source parameters using CDN managed + * certificate for enabling SSL. + * + * @param certificateSourceParameters the certificateSourceParameters value to set. + * @return the CdnManagedHttpsParameters object itself. + */ + public CdnManagedHttpsParameters withCertificateSourceParameters( + CdnCertificateSourceParameters certificateSourceParameters) { + this.certificateSourceParameters = certificateSourceParameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public CdnManagedHttpsParameters withProtocolType(ProtocolType protocolType) { + super.withProtocolType(protocolType); + return this; + } + + /** {@inheritDoc} */ + @Override + public CdnManagedHttpsParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + super.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (certificateSourceParameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateSourceParameters in model CdnManagedHttpsParameters")); + } else { + certificateSourceParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CdnManagedHttpsParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.java new file mode 100644 index 0000000000000..ddbfe622d4321 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CdnWebApplicationFirewallPolicy. */ +public interface CdnWebApplicationFirewallPolicy { + /** + * 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: Gets a unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the policySettings property: Describes policySettings for policy. + * + * @return the policySettings value. + */ + PolicySettings policySettings(); + + /** + * Gets the rateLimitRules property: Describes rate limit rules inside the policy. + * + * @return the rateLimitRules value. + */ + RateLimitRuleList rateLimitRules(); + + /** + * Gets the customRules property: Describes custom rules inside the policy. + * + * @return the customRules value. + */ + CustomRuleList customRules(); + + /** + * Gets the managedRules property: Describes managed rules inside the policy. + * + * @return the managedRules value. + */ + ManagedRuleSetList managedRules(); + + /** + * Gets the endpointLinks property: Describes Azure CDN endpoints associated with this Web Application Firewall + * policy. + * + * @return the endpointLinks value. + */ + List endpointLinks(); + + /** + * Gets the extendedProperties property: Key-Value pair representing additional properties for Web Application + * Firewall policy. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the provisioningState property: Provisioning state of the WebApplicationFirewallPolicy. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + PolicyResourceState resourceState(); + + /** + * 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.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner object. + * + * @return the inner object. + */ + CdnWebApplicationFirewallPolicyInner innerModel(); + + /** The entirety of the CdnWebApplicationFirewallPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The CdnWebApplicationFirewallPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the CdnWebApplicationFirewallPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CdnWebApplicationFirewallPolicy 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 CdnWebApplicationFirewallPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy.. + * + * @param sku The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the CdnWebApplicationFirewallPolicy 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.WithPolicySettings, + DefinitionStages.WithRateLimitRules, + DefinitionStages.WithCustomRules, + DefinitionStages.WithManagedRules, + DefinitionStages.WithExtendedProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CdnWebApplicationFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CdnWebApplicationFirewallPolicy create(Context context); + } + /** The stage of the CdnWebApplicationFirewallPolicy 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 CdnWebApplicationFirewallPolicy definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Gets a unique read-only string that changes whenever the resource is + * updated.. + * + * @param etag Gets a unique read-only string that changes whenever the resource is updated. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: Describes policySettings for policy. + * + * @param policySettings Describes policySettings for policy. + * @return the next definition stage. + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify rateLimitRules. */ + interface WithRateLimitRules { + /** + * Specifies the rateLimitRules property: Describes rate limit rules inside the policy.. + * + * @param rateLimitRules Describes rate limit rules inside the policy. + * @return the next definition stage. + */ + WithCreate withRateLimitRules(RateLimitRuleList rateLimitRules); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify customRules. */ + interface WithCustomRules { + /** + * Specifies the customRules property: Describes custom rules inside the policy.. + * + * @param customRules Describes custom rules inside the policy. + * @return the next definition stage. + */ + WithCreate withCustomRules(CustomRuleList customRules); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes managed rules inside the policy.. + * + * @param managedRules Describes managed rules inside the policy. + * @return the next definition stage. + */ + WithCreate withManagedRules(ManagedRuleSetList managedRules); + } + /** The stage of the CdnWebApplicationFirewallPolicy definition allowing to specify extendedProperties. */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: Key-Value pair representing additional properties for Web + * Application Firewall policy.. + * + * @param extendedProperties Key-Value pair representing additional properties for Web Application Firewall + * policy. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Map extendedProperties); + } + } + /** + * Begins update for the CdnWebApplicationFirewallPolicy resource. + * + * @return the stage of resource update. + */ + CdnWebApplicationFirewallPolicy.Update update(); + + /** The template for CdnWebApplicationFirewallPolicy update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CdnWebApplicationFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CdnWebApplicationFirewallPolicy apply(Context context); + } + /** The CdnWebApplicationFirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the CdnWebApplicationFirewallPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @param tags CdnWebApplicationFirewallPolicy tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CdnWebApplicationFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CdnWebApplicationFirewallPolicy refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java new file mode 100644 index 0000000000000..038fdad0b7927 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy + * objects and a URL link to get the next set of results. + */ +@Fluent +public final class CdnWebApplicationFirewallPolicyList { + /* + * List of Azure CDN WebApplicationFirewallPolicies within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CdnWebApplicationFirewallPolicyList class. */ + public CdnWebApplicationFirewallPolicyList() { + } + + /** + * Get the value property: List of Azure CDN WebApplicationFirewallPolicies within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the CdnWebApplicationFirewallPolicyList object itself. + */ + public CdnWebApplicationFirewallPolicyList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.java new file mode 100644 index 0000000000000..b1534d43a75fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to update a CdnWebApplicationFirewallPolicy. */ +@Fluent +public final class CdnWebApplicationFirewallPolicyPatchParameters { + /* + * CdnWebApplicationFirewallPolicy tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of CdnWebApplicationFirewallPolicyPatchParameters class. */ + public CdnWebApplicationFirewallPolicyPatchParameters() { + } + + /** + * Get the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: CdnWebApplicationFirewallPolicy tags. + * + * @param tags the tags value to set. + * @return the CdnWebApplicationFirewallPolicyPatchParameters object itself. + */ + public CdnWebApplicationFirewallPolicyPatchParameters 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.java new file mode 100644 index 0000000000000..136383a3f1e90 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate used for https. */ +@Fluent +public class Certificate { + /* + * The type of the secret resource. + */ + @JsonProperty(value = "type") + private SecretType type; + + /* + * Subject name in the certificate. + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /* + * Certificate expiration date. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /** Creates an instance of Certificate class. */ + public Certificate() { + } + + /** + * Get the type property: The type of the secret resource. + * + * @return the type value. + */ + public SecretType type() { + return this.type; + } + + /** + * Set the type property: The type of the secret resource. + * + * @param type the type value to set. + * @return the Certificate object itself. + */ + public Certificate withType(SecretType type) { + this.type = type; + return this; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.java new file mode 100644 index 0000000000000..e9e32c92534dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the source of the SSL certificate. */ +public final class CertificateSource extends ExpandableStringEnum { + /** Static value AzureKeyVault for CertificateSource. */ + public static final CertificateSource AZURE_KEY_VAULT = fromString("AzureKeyVault"); + + /** Static value Cdn for CertificateSource. */ + public static final CertificateSource CDN = fromString("Cdn"); + + /** + * Creates or finds a CertificateSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateSource. + */ + @JsonCreator + public static CertificateSource fromString(String name) { + return fromString(name, CertificateSource.class); + } + + /** + * Gets known CertificateSource values. + * + * @return known CertificateSource values. + */ + public static Collection values() { + return values(CertificateSource.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.java new file mode 100644 index 0000000000000..07ed67d0fe871 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of certificate used. */ +public final class CertificateType extends ExpandableStringEnum { + /** Static value Shared for CertificateType. */ + public static final CertificateType SHARED = fromString("Shared"); + + /** Static value Dedicated for CertificateType. */ + public static final CertificateType DEDICATED = fromString("Dedicated"); + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + @JsonCreator + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * Gets known CertificateType values. + * + * @return known CertificateType values. + */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.java new file mode 100644 index 0000000000000..b2eeec5f877f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityInput.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of CheckNameAvailability API. */ +@Fluent +public final class CheckEndpointNameAvailabilityInput { + /* + * The resource name to validate. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of the resource whose name is to be validated. + */ + @JsonProperty(value = "type", required = true) + private ResourceType type; + + /* + * Indicates the endpoint name reuse scope. The default value is TenantReuse. + */ + @JsonProperty(value = "autoGeneratedDomainNameLabelScope") + private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope; + + /** Creates an instance of CheckEndpointNameAvailabilityInput class. */ + public CheckEndpointNameAvailabilityInput() { + } + + /** + * Get the name property: The resource name to validate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to validate. + * + * @param name the name value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource whose name is to be validated. + * + * @return the type value. + */ + public ResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the resource whose name is to be validated. + * + * @param type the type value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput withType(ResourceType type) { + this.type = type; + return this; + } + + /** + * Get the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @return the autoGeneratedDomainNameLabelScope value. + */ + public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() { + return this.autoGeneratedDomainNameLabelScope; + } + + /** + * Set the autoGeneratedDomainNameLabelScope property: Indicates the endpoint name reuse scope. The default value is + * TenantReuse. + * + * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set. + * @return the CheckEndpointNameAvailabilityInput object itself. + */ + public CheckEndpointNameAvailabilityInput withAutoGeneratedDomainNameLabelScope( + AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) { + this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CheckEndpointNameAvailabilityInput")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model CheckEndpointNameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckEndpointNameAvailabilityInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java new file mode 100644 index 0000000000000..fb83b7be2b51b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckEndpointNameAvailabilityOutput.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner; + +/** An immutable client-side representation of CheckEndpointNameAvailabilityOutput. */ +public interface CheckEndpointNameAvailabilityOutput { + /** + * Gets the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the availableHostname property: Returns the available hostname generated based on the + * AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string. + * + * @return the availableHostname value. + */ + String availableHostname(); + + /** + * Gets the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CheckEndpointNameAvailabilityOutputInner + * object. + * + * @return the inner object. + */ + CheckEndpointNameAvailabilityOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.java new file mode 100644 index 0000000000000..e68fea7b6b589 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckHostnameAvailabilityInput.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of CheckHostNameAvailability API. */ +@Fluent +public final class CheckHostnameAvailabilityInput { + /* + * The host name to validate. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /** Creates an instance of CheckHostnameAvailabilityInput class. */ + public CheckHostnameAvailabilityInput() { + } + + /** + * Get the hostname property: The host name to validate. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name to validate. + * + * @param hostname the hostname value to set. + * @return the CheckHostnameAvailabilityInput object itself. + */ + public CheckHostnameAvailabilityInput withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model CheckHostnameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckHostnameAvailabilityInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..eb4f79619b82b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of CheckNameAvailability API. */ +@Fluent +public final class CheckNameAvailabilityInput { + /* + * The resource name to validate. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of the resource whose name is to be validated. + */ + @JsonProperty(value = "type", required = true) + private ResourceType type; + + /** Creates an instance of CheckNameAvailabilityInput class. */ + public CheckNameAvailabilityInput() { + } + + /** + * Get the name property: The resource name to validate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to validate. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource whose name is to be validated. + * + * @return the type value. + */ + public ResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the resource whose name is to be validated. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(ResourceType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityOutput.java new file mode 100644 index 0000000000000..6c71cf9bd191d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityOutput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner; + +/** An immutable client-side representation of CheckNameAvailabilityOutput. */ +public interface CheckNameAvailabilityOutput { + /** + * Gets the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The detailed error message describing why the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CheckNameAvailabilityOutputInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CidrIpAddress.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CidrIpAddress.java new file mode 100644 index 0000000000000..bb7d90232b8f5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CidrIpAddress.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CIDR Ip address. */ +@Fluent +public final class CidrIpAddress { + /* + * Ip address itself. + */ + @JsonProperty(value = "baseIpAddress") + private String baseIpAddress; + + /* + * The length of the prefix of the ip address. + */ + @JsonProperty(value = "prefixLength") + private Integer prefixLength; + + /** Creates an instance of CidrIpAddress class. */ + public CidrIpAddress() { + } + + /** + * Get the baseIpAddress property: Ip address itself. + * + * @return the baseIpAddress value. + */ + public String baseIpAddress() { + return this.baseIpAddress; + } + + /** + * Set the baseIpAddress property: Ip address itself. + * + * @param baseIpAddress the baseIpAddress value to set. + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withBaseIpAddress(String baseIpAddress) { + this.baseIpAddress = baseIpAddress; + return this; + } + + /** + * Get the prefixLength property: The length of the prefix of the ip address. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Set the prefixLength property: The length of the prefix of the ip address. + * + * @param prefixLength the prefixLength value to set. + * @return the CidrIpAddress object itself. + */ + public CidrIpAddress withPrefixLength(Integer prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java new file mode 100644 index 0000000000000..376c6931fbe5b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for ClientPort match conditions. */ +@Fluent +public final class ClientPortMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleClientPortConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private ClientPortOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of ClientPortMatchConditionParameters class. */ + public ClientPortMatchConditionParameters() { + typeName = "DeliveryRuleClientPortConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public ClientPortOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withOperator(ClientPortOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the ClientPortMatchConditionParameters object itself. + */ + public ClientPortMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model ClientPortMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClientPortMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.java new file mode 100644 index 0000000000000..94cef8d74a3d9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ClientPortOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class ClientPortOperator extends ExpandableStringEnum { + /** Static value Any for ClientPortOperator. */ + public static final ClientPortOperator ANY = fromString("Any"); + + /** Static value Equal for ClientPortOperator. */ + public static final ClientPortOperator EQUAL = fromString("Equal"); + + /** Static value Contains for ClientPortOperator. */ + public static final ClientPortOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for ClientPortOperator. */ + public static final ClientPortOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for ClientPortOperator. */ + public static final ClientPortOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for ClientPortOperator. */ + public static final ClientPortOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for ClientPortOperator. */ + public static final ClientPortOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for ClientPortOperator. */ + public static final ClientPortOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for ClientPortOperator. */ + public static final ClientPortOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for ClientPortOperator. */ + public static final ClientPortOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a ClientPortOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientPortOperator. + */ + @JsonCreator + public static ClientPortOperator fromString(String name) { + return fromString(name, ClientPortOperator.class); + } + + /** + * Gets known ClientPortOperator values. + * + * @return known ClientPortOperator values. + */ + public static Collection values() { + return values(ClientPortOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.java new file mode 100644 index 0000000000000..6c85f2d711042 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CompressionSettings.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** settings for compression. */ +@Fluent +public final class CompressionSettings { + /* + * List of content types on which compression applies. The value should be a valid MIME type. + */ + @JsonProperty(value = "contentTypesToCompress") + private List contentTypesToCompress; + + /* + * Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is + * enabled, content will be served as compressed if user requests for a compressed version. Content won't be + * compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + */ + @JsonProperty(value = "isCompressionEnabled") + private Boolean isCompressionEnabled; + + /** Creates an instance of CompressionSettings class. */ + public CompressionSettings() { + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.contentTypesToCompress; + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the CompressionSettings object itself. + */ + public CompressionSettings withContentTypesToCompress(List contentTypesToCompress) { + this.contentTypesToCompress = contentTypesToCompress; + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on AzureFrontDoor. + * Default value is false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte + * or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.isCompressionEnabled; + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on AzureFrontDoor. + * Default value is false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte + * or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the CompressionSettings object itself. + */ + public CompressionSettings withIsCompressionEnabled(Boolean isCompressionEnabled) { + this.isCompressionEnabled = isCompressionEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponse.java new file mode 100644 index 0000000000000..d1f28659648ec --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner; +import java.util.List; + +/** An immutable client-side representation of ContinentsResponse. */ +public interface ContinentsResponse { + /** + * Gets the continents property: The continents property. + * + * @return the continents value. + */ + List continents(); + + /** + * Gets the countryOrRegions property: The countryOrRegions property. + * + * @return the countryOrRegions value. + */ + List countryOrRegions(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ContinentsResponseInner object. + * + * @return the inner object. + */ + ContinentsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseContinentsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseContinentsItem.java new file mode 100644 index 0000000000000..037a849ab82e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseContinentsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContinentsResponseContinentsItem model. */ +@Fluent +public final class ContinentsResponseContinentsItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ContinentsResponseContinentsItem class. */ + public ContinentsResponseContinentsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ContinentsResponseContinentsItem object itself. + */ + public ContinentsResponseContinentsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseCountryOrRegionsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseCountryOrRegionsItem.java new file mode 100644 index 0000000000000..3dc89082fb5c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseCountryOrRegionsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContinentsResponseCountryOrRegionsItem model. */ +@Fluent +public final class ContinentsResponseCountryOrRegionsItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The continentId property. + */ + @JsonProperty(value = "continentId") + private String continentId; + + /** Creates an instance of ContinentsResponseCountryOrRegionsItem class. */ + public ContinentsResponseCountryOrRegionsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ContinentsResponseCountryOrRegionsItem object itself. + */ + public ContinentsResponseCountryOrRegionsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the continentId property: The continentId property. + * + * @return the continentId value. + */ + public String continentId() { + return this.continentId; + } + + /** + * Set the continentId property: The continentId property. + * + * @param continentId the continentId value to set. + * @return the ContinentsResponseCountryOrRegionsItem object itself. + */ + public ContinentsResponseCountryOrRegionsItem withContinentId(String continentId) { + this.continentId = continentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java new file mode 100644 index 0000000000000..71d992cdef8db --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for Cookies match conditions. */ +@Fluent +public final class CookiesMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleCookiesConditionParameters"; + + /* + * Name of Cookies to be matched + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private CookiesOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of CookiesMatchConditionParameters class. */ + public CookiesMatchConditionParameters() { + typeName = "DeliveryRuleCookiesConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the selector property: Name of Cookies to be matched. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Name of Cookies to be matched. + * + * @param selector the selector value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public CookiesOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withOperator(CookiesOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model CookiesMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CookiesMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.java new file mode 100644 index 0000000000000..d322a899aadd2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class CookiesOperator extends ExpandableStringEnum { + /** Static value Any for CookiesOperator. */ + public static final CookiesOperator ANY = fromString("Any"); + + /** Static value Equal for CookiesOperator. */ + public static final CookiesOperator EQUAL = fromString("Equal"); + + /** Static value Contains for CookiesOperator. */ + public static final CookiesOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for CookiesOperator. */ + public static final CookiesOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for CookiesOperator. */ + public static final CookiesOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for CookiesOperator. */ + public static final CookiesOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for CookiesOperator. */ + public static final CookiesOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for CookiesOperator. */ + public static final CookiesOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for CookiesOperator. */ + public static final CookiesOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for CookiesOperator. */ + public static final CookiesOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a CookiesOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding CookiesOperator. + */ + @JsonCreator + public static CookiesOperator fromString(String name) { + return fromString(name, CookiesOperator.class); + } + + /** + * Gets known CookiesOperator values. + * + * @return known CookiesOperator values. + */ + public static Collection values() { + return values(CookiesOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java new file mode 100644 index 0000000000000..e8b66989c122d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; + +/** An immutable client-side representation of CustomDomain. */ +public interface CustomDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the resourceState property: Resource status of the custom domain. + * + * @return the resourceState value. + */ + CustomDomainResourceState resourceState(); + + /** + * Gets the customHttpsProvisioningState property: Provisioning status of the custom domain. + * + * @return the customHttpsProvisioningState value. + */ + CustomHttpsProvisioningState customHttpsProvisioningState(); + + /** + * Gets the customHttpsProvisioningSubstate property: Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. + * + * @return the customHttpsProvisioningSubstate value. + */ + CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate(); + + /** + * Gets the customHttpsParameters property: Certificate parameters for securing custom HTTPS. + * + * @return the customHttpsParameters value. + */ + CustomDomainHttpsParameters customHttpsParameters(); + + /** + * Gets the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + String validationData(); + + /** + * Gets the provisioningState property: Provisioning status of Custom Https of the custom domain. + * + * @return the provisioningState value. + */ + CustomHttpsProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner object. + * + * @return the inner object. + */ + CustomDomainInner innerModel(); + + /** The entirety of the CustomDomain definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CustomDomain definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomDomain definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CustomDomain definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + /** + * The stage of the CustomDomain 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.WithHostname { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomDomain create(Context context); + } + /** The stage of the CustomDomain definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The host name of the custom domain. Must be a domain name.. + * + * @param hostname The host name of the custom domain. Must be a domain name. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomDomain refresh(Context context); + + /** + * Disable https delivery of the custom domain. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(); + + /** + * Disable https delivery of the custom domain. + * + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps(Context context); + + /** + * Enable https delivery of the custom domain. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(); + + /** + * Enable https delivery of the custom domain. + * + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps(CustomDomainHttpsParameters customDomainHttpsParameters, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java new file mode 100644 index 0000000000000..ec7ff6c22150c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The JSON object that contains the properties to secure a custom domain. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "certificateSource", + defaultImpl = CustomDomainHttpsParameters.class) +@JsonTypeName("CustomDomainHttpsParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Cdn", value = CdnManagedHttpsParameters.class), + @JsonSubTypes.Type(name = "AzureKeyVault", value = UserManagedHttpsParameters.class) +}) +@Fluent +public class CustomDomainHttpsParameters { + /* + * Defines the TLS extension protocol that is used for secure delivery. + */ + @JsonProperty(value = "protocolType", required = true) + private ProtocolType protocolType; + + /* + * TLS protocol version that will be used for Https + */ + @JsonProperty(value = "minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /** Creates an instance of CustomDomainHttpsParameters class. */ + public CustomDomainHttpsParameters() { + } + + /** + * Get the protocolType property: Defines the TLS extension protocol that is used for secure delivery. + * + * @return the protocolType value. + */ + public ProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Defines the TLS extension protocol that is used for secure delivery. + * + * @param protocolType the protocolType value to set. + * @return the CustomDomainHttpsParameters object itself. + */ + public CustomDomainHttpsParameters withProtocolType(ProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: TLS protocol version that will be used for Https. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the CustomDomainHttpsParameters object itself. + */ + public CustomDomainHttpsParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocolType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocolType in model CustomDomainHttpsParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainHttpsParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainListResult.java new file mode 100644 index 0000000000000..ac95df6f6a1d2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the + * next set of results. + */ +@Fluent +public final class CustomDomainListResult { + /* + * List of CDN CustomDomains within an endpoint. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of custom domain objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CustomDomainListResult class. */ + public CustomDomainListResult() { + } + + /** + * Get the value property: List of CDN CustomDomains within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the CustomDomainListResult object itself. + */ + public CustomDomainListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.java new file mode 100644 index 0000000000000..2698566d83a99 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainPropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The customDomain JSON object required for custom domain creation or update. */ +@Fluent +public final class CustomDomainParameters { + /* + * The JSON object that contains the properties of the custom domain to create. + */ + @JsonProperty(value = "properties") + private CustomDomainPropertiesParameters innerProperties; + + /** Creates an instance of CustomDomainParameters class. */ + public CustomDomainParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the custom domain to create. + * + * @return the innerProperties value. + */ + private CustomDomainPropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the CustomDomainParameters object itself. + */ + public CustomDomainParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomDomainPropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.java new file mode 100644 index 0000000000000..ea8bacb669431 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the custom domain. */ +public final class CustomDomainResourceState extends ExpandableStringEnum { + /** Static value Creating for CustomDomainResourceState. */ + public static final CustomDomainResourceState CREATING = fromString("Creating"); + + /** Static value Active for CustomDomainResourceState. */ + public static final CustomDomainResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for CustomDomainResourceState. */ + public static final CustomDomainResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a CustomDomainResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomDomainResourceState. + */ + @JsonCreator + public static CustomDomainResourceState fromString(String name) { + return fromString(name, CustomDomainResourceState.class); + } + + /** + * Gets known CustomDomainResourceState values. + * + * @return known CustomDomainResourceState values. + */ + public static Collection values() { + return values(CustomDomainResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java new file mode 100644 index 0000000000000..c8a7234905df2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 CustomDomains. */ +public interface CustomDomains { + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing custom domains within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list custom domains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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 an existing custom domain within an endpoint along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing custom domain within an endpoint. + */ + CustomDomain get(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + CustomDomain delete(String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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. + */ + CustomDomain delete( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Disable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain disableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps( + String resourceGroupName, String profileName, String endpointName, String customDomainName); + + /** + * Enable https delivery of the custom domain. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainName Name of the custom domain within an endpoint. + * @param customDomainHttpsParameters The configuration specifying how to enable HTTPS for the custom domain - using + * CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed + * certificate by default. + * @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e.g. + */ + CustomDomain enableCustomHttps( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context); + + /** + * Gets an existing custom domain within an endpoint. + * + * @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 an existing custom domain within an endpoint along with {@link Response}. + */ + CustomDomain getById(String id); + + /** + * Gets an existing custom domain within an endpoint. + * + * @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 an existing custom domain within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain deleteById(String id); + + /** + * Deletes an existing custom domain within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CustomDomain deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomDomain resource. + * + * @param name resource name. + * @return the first stage of the new CustomDomain definition. + */ + CustomDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java new file mode 100644 index 0000000000000..26f9f0242823f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the custom domain. */ +public final class CustomHttpsProvisioningState extends ExpandableStringEnum { + /** Static value Enabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLING = fromString("Enabling"); + + /** Static value Enabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState ENABLED = fromString("Enabled"); + + /** Static value Disabling for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLING = fromString("Disabling"); + + /** Static value Disabled for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState DISABLED = fromString("Disabled"); + + /** Static value Failed for CustomHttpsProvisioningState. */ + public static final CustomHttpsProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a CustomHttpsProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningState. + */ + @JsonCreator + public static CustomHttpsProvisioningState fromString(String name) { + return fromString(name, CustomHttpsProvisioningState.class); + } + + /** + * Gets known CustomHttpsProvisioningState values. + * + * @return known CustomHttpsProvisioningState values. + */ + public static Collection values() { + return values(CustomHttpsProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java new file mode 100644 index 0000000000000..6dc0e8a28072c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. */ +public final class CustomHttpsProvisioningSubstate extends ExpandableStringEnum { + /** Static value SubmittingDomainControlValidationRequest for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate SUBMITTING_DOMAIN_CONTROL_VALIDATION_REQUEST = + fromString("SubmittingDomainControlValidationRequest"); + + /** Static value PendingDomainControlValidationREquestApproval for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate PENDING_DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVAL = + fromString("PendingDomainControlValidationREquestApproval"); + + /** Static value DomainControlValidationRequestApproved for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_APPROVED = + fromString("DomainControlValidationRequestApproved"); + + /** Static value DomainControlValidationRequestRejected for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_REJECTED = + fromString("DomainControlValidationRequestRejected"); + + /** Static value DomainControlValidationRequestTimedOut for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DOMAIN_CONTROL_VALIDATION_REQUEST_TIMED_OUT = + fromString("DomainControlValidationRequestTimedOut"); + + /** Static value IssuingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate ISSUING_CERTIFICATE = fromString("IssuingCertificate"); + + /** Static value DeployingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DEPLOYING_CERTIFICATE = fromString("DeployingCertificate"); + + /** Static value CertificateDeployed for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DEPLOYED = fromString("CertificateDeployed"); + + /** Static value DeletingCertificate for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate DELETING_CERTIFICATE = fromString("DeletingCertificate"); + + /** Static value CertificateDeleted for CustomHttpsProvisioningSubstate. */ + public static final CustomHttpsProvisioningSubstate CERTIFICATE_DELETED = fromString("CertificateDeleted"); + + /** + * Creates or finds a CustomHttpsProvisioningSubstate from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomHttpsProvisioningSubstate. + */ + @JsonCreator + public static CustomHttpsProvisioningSubstate fromString(String name) { + return fromString(name, CustomHttpsProvisioningSubstate.class); + } + + /** + * Gets known CustomHttpsProvisioningSubstate values. + * + * @return known CustomHttpsProvisioningSubstate values. + */ + public static Collection values() { + return values(CustomHttpsProvisioningSubstate.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java new file mode 100644 index 0000000000000..4260247ab9763 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the common attributes for a custom rule that can be included in a waf policy. */ +@Fluent +public class CustomRule { + /* + * Defines the name of the custom rule + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ + @JsonProperty(value = "enabledState") + private CustomRuleEnabledState enabledState; + + /* + * Defines in what order this rule be evaluated in the overall list of custom rules + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /* + * Describes what action to be applied when rule matches + */ + @JsonProperty(value = "action", required = true) + private ActionType action; + + /** Creates an instance of CustomRule class. */ + public CustomRule() { + } + + /** + * Get the name property: Defines the name of the custom rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Defines the name of the custom rule. + * + * @param name the name value to set. + * @return the CustomRule object itself. + */ + public CustomRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled + * if not specified. + * + * @return the enabledState value. + */ + public CustomRuleEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled + * if not specified. + * + * @param enabledState the enabledState value to set. + * @return the CustomRule object itself. + */ + public CustomRule withEnabledState(CustomRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules. + * + * @param priority the priority value to set. + * @return the CustomRule object itself. + */ + public CustomRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the matchConditions property: List of match conditions. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: List of match conditions. + * + * @param matchConditions the matchConditions value to set. + * @return the CustomRule object itself. + */ + public CustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get the action property: Describes what action to be applied when rule matches. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Describes what action to be applied when rule matches. + * + * @param action the action value to set. + * @return the CustomRule object itself. + */ + public CustomRule withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CustomRule")); + } + if (matchConditions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchConditions in model CustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model CustomRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomRule.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.java new file mode 100644 index 0000000000000..d7b83462a4751 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. */ +public final class CustomRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for CustomRuleEnabledState. */ + public static final CustomRuleEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for CustomRuleEnabledState. */ + public static final CustomRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a CustomRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomRuleEnabledState. + */ + @JsonCreator + public static CustomRuleEnabledState fromString(String name) { + return fromString(name, CustomRuleEnabledState.class); + } + + /** + * Gets known CustomRuleEnabledState values. + * + * @return known CustomRuleEnabledState values. + */ + public static Collection values() { + return values(CustomRuleEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java new file mode 100644 index 0000000000000..e7698e73c5bb1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of custom rules. */ +@Fluent +public final class CustomRuleList { + /* + * List of rules + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of CustomRuleList class. */ + public CustomRuleList() { + } + + /** + * Get the rules property: List of rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules. + * + * @param rules the rules value to set. + * @return the CustomRuleList object itself. + */ + public CustomRuleList withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.java new file mode 100644 index 0000000000000..e715606692b2a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Customer Certificate used for https. */ +@Fluent +public final class CustomerCertificate extends Certificate { + /* + * Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + @JsonProperty(value = "secretSource") + private ResourceReference secretSource; + + /* + * Certificate version. + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /* + * Certificate issuing authority. + */ + @JsonProperty(value = "certificateAuthority", access = JsonProperty.Access.WRITE_ONLY) + private String certificateAuthority; + + /* + * Whether to use the latest version for the certificate + */ + @JsonProperty(value = "useLatestVersion") + private Boolean useLatestVersion; + + /* + * The list of SANs. + */ + @JsonProperty(value = "subjectAlternativeNames") + private List subjectAlternativeNames; + + /* + * Certificate thumbprint. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** Creates an instance of CustomerCertificate class. */ + public CustomerCertificate() { + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Certificate version. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Certificate version. + * + * @param secretVersion the secretVersion value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @return the useLatestVersion value. + */ + public Boolean useLatestVersion() { + return this.useLatestVersion; + } + + /** + * Set the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @param useLatestVersion the useLatestVersion value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withUseLatestVersion(Boolean useLatestVersion) { + this.useLatestVersion = useLatestVersion; + return this; + } + + /** + * Get the subjectAlternativeNames property: The list of SANs. + * + * @return the subjectAlternativeNames value. + */ + public List subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames property: The list of SANs. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withSubjectAlternativeNames(List subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** {@inheritDoc} */ + @Override + public CustomerCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (secretSource() != null) { + secretSource().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java new file mode 100644 index 0000000000000..cee6f25a85c29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Customer Certificate used for https. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("CustomerCertificate") +@Fluent +public final class CustomerCertificateParameters extends SecretParameters { + /* + * Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /* + * Whether to use the latest version for the certificate + */ + @JsonProperty(value = "useLatestVersion") + private Boolean useLatestVersion; + + /* + * Subject name in the certificate. + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /* + * Certificate expiration date. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /* + * Certificate issuing authority. + */ + @JsonProperty(value = "certificateAuthority", access = JsonProperty.Access.WRITE_ONLY) + private String certificateAuthority; + + /* + * The list of SANs. + */ + @JsonProperty(value = "subjectAlternativeNames") + private List subjectAlternativeNames; + + /* + * Certificate thumbprint. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** Creates an instance of CustomerCertificateParameters class. */ + public CustomerCertificateParameters() { + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault certificate. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Version of the secret to be used. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Version of the secret to be used. + * + * @param secretVersion the secretVersion value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @return the useLatestVersion value. + */ + public Boolean useLatestVersion() { + return this.useLatestVersion; + } + + /** + * Set the useLatestVersion property: Whether to use the latest version for the certificate. + * + * @param useLatestVersion the useLatestVersion value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withUseLatestVersion(Boolean useLatestVersion) { + this.useLatestVersion = useLatestVersion; + return this; + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the subjectAlternativeNames property: The list of SANs. + * + * @return the subjectAlternativeNames value. + */ + public List subjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Set the subjectAlternativeNames property: The list of SANs. + * + * @param subjectAlternativeNames the subjectAlternativeNames value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withSubjectAlternativeNames(List subjectAlternativeNames) { + this.subjectAlternativeNames = subjectAlternativeNames; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (secretSource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretSource in model CustomerCertificateParameters")); + } else { + secretSource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomerCertificateParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java new file mode 100644 index 0000000000000..df8f584fb09a2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedCustomDomain.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedCustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domains created on the CDN endpoint. */ +@Fluent +public final class DeepCreatedCustomDomain { + /* + * Custom domain name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the custom domain created on the CDN endpoint. + */ + @JsonProperty(value = "properties") + private DeepCreatedCustomDomainProperties innerProperties; + + /** Creates an instance of DeepCreatedCustomDomain class. */ + public DeepCreatedCustomDomain() { + } + + /** + * Get the name property: Custom domain name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom domain name. + * + * @param name the name value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the custom domain created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedCustomDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedCustomDomainProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @return the validationData value. + */ + public String validationData() { + return this.innerProperties() == null ? null : this.innerProperties().validationData(); + } + + /** + * Set the validationData property: Special validation or data may be required when delivering CDN to some regions + * due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in + * China. + * + * @param validationData the validationData value to set. + * @return the DeepCreatedCustomDomain object itself. + */ + public DeepCreatedCustomDomain withValidationData(String validationData) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedCustomDomainProperties(); + } + this.innerProperties().withValidationData(validationData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DeepCreatedCustomDomain")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedCustomDomain.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java new file mode 100644 index 0000000000000..2eb9179108002 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedOriginProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The main origin of CDN content which is added when creating a CDN endpoint. */ +@Fluent +public final class DeepCreatedOrigin { + /* + * Origin name which must be unique within the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the origin created on the CDN endpoint. + */ + @JsonProperty(value = "properties") + private DeepCreatedOriginProperties innerProperties; + + /** Creates an instance of DeepCreatedOrigin class. */ + public DeepCreatedOrigin() { + } + + /** + * Get the name property: Origin name which must be unique within the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Origin name which must be unique within the endpoint. + * + * @param name the name value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the origin created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedOriginProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. + * This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. By default, origin is always enabled. + * + * @param enabled the enabled value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginProperties(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + return this; + } + + /** + * Get the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DeepCreatedOrigin")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOrigin.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOriginGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOriginGroup.java new file mode 100644 index 0000000000000..5e1b27a98e810 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOriginGroup.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.DeepCreatedOriginGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within + * the origin group based on origin health. + */ +@Fluent +public final class DeepCreatedOriginGroup { + /* + * Origin group name which must be unique within the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the origin group created on the CDN endpoint. + */ + @JsonProperty(value = "properties") + private DeepCreatedOriginGroupProperties innerProperties; + + /** Creates an instance of DeepCreatedOriginGroup class. */ + public DeepCreatedOriginGroup() { + } + + /** + * Get the name property: Origin group name which must be unique within the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Origin group name which must be unique within the endpoint. + * + * @param name the name value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the origin group created on the CDN endpoint. + * + * @return the innerProperties value. + */ + private DeepCreatedOriginGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this + .innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses.This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DeepCreatedOriginGroupProperties(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DeepCreatedOriginGroup")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeepCreatedOriginGroup.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.java new file mode 100644 index 0000000000000..72700b9ee78f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the action that shall be taken when the certificate is removed from Key Vault. */ +public final class DeleteRule extends ExpandableStringEnum { + /** Static value NoAction for DeleteRule. */ + public static final DeleteRule NO_ACTION = fromString("NoAction"); + + /** + * Creates or finds a DeleteRule from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteRule. + */ + @JsonCreator + public static DeleteRule fromString(String name) { + return fromString(name, DeleteRule.class); + } + + /** + * Gets known DeleteRule values. + * + * @return known DeleteRule values. + */ + public static Collection values() { + return values(DeleteRule.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java new file mode 100644 index 0000000000000..3a8bdd3ac9a3f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A rule that specifies a set of actions and conditions. */ +@Fluent +public final class DeliveryRule { + /* + * Name of the rule + */ + @JsonProperty(value = "name") + private String name; + + /* + * The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser + * order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not + * require any condition and actions listed in it will always be applied. + */ + @JsonProperty(value = "order", required = true) + private int order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule are satisfied. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /** Creates an instance of DeliveryRule class. */ + public DeliveryRule() { + } + + /** + * Get the name property: Name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rule. + * + * @param name the name value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public int order() { + return this.order; + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withOrder(int order) { + this.order = order; + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the DeliveryRule object itself. + */ + public DeliveryRule withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actions in model DeliveryRule")); + } else { + actions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRule.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.java new file mode 100644 index 0000000000000..f15d12f7170d5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** An action for the delivery rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "name", + defaultImpl = DeliveryRuleAction.class) +@JsonTypeName("DeliveryRuleAction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "UrlRedirect", value = UrlRedirectAction.class), + @JsonSubTypes.Type(name = "UrlSigning", value = UrlSigningAction.class), + @JsonSubTypes.Type(name = "OriginGroupOverride", value = OriginGroupOverrideAction.class), + @JsonSubTypes.Type(name = "UrlRewrite", value = UrlRewriteAction.class), + @JsonSubTypes.Type(name = "ModifyRequestHeader", value = DeliveryRuleRequestHeaderAction.class), + @JsonSubTypes.Type(name = "ModifyResponseHeader", value = DeliveryRuleResponseHeaderAction.class), + @JsonSubTypes.Type(name = "CacheExpiration", value = DeliveryRuleCacheExpirationAction.class), + @JsonSubTypes.Type(name = "CacheKeyQueryString", value = DeliveryRuleCacheKeyQueryStringAction.class), + @JsonSubTypes.Type(name = "RouteConfigurationOverride", value = DeliveryRuleRouteConfigurationOverrideAction.class) +}) +@Immutable +public class DeliveryRuleAction { + /** Creates an instance of DeliveryRuleAction class. */ + public DeliveryRuleAction() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.java new file mode 100644 index 0000000000000..b503094bbae40 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name of the action for the delivery rule. */ +public final class DeliveryRuleActionValue extends ExpandableStringEnum { + /** Static value CacheExpiration for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue CACHE_EXPIRATION = fromString("CacheExpiration"); + + /** Static value CacheKeyQueryString for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue CACHE_KEY_QUERY_STRING = fromString("CacheKeyQueryString"); + + /** Static value ModifyRequestHeader for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue MODIFY_REQUEST_HEADER = fromString("ModifyRequestHeader"); + + /** Static value ModifyResponseHeader for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue MODIFY_RESPONSE_HEADER = fromString("ModifyResponseHeader"); + + /** Static value UrlRedirect for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue URL_REDIRECT = fromString("UrlRedirect"); + + /** Static value UrlRewrite for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue URL_REWRITE = fromString("UrlRewrite"); + + /** Static value UrlSigning for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue URL_SIGNING = fromString("UrlSigning"); + + /** Static value OriginGroupOverride for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue ORIGIN_GROUP_OVERRIDE = fromString("OriginGroupOverride"); + + /** Static value RouteConfigurationOverride for DeliveryRuleActionValue. */ + public static final DeliveryRuleActionValue ROUTE_CONFIGURATION_OVERRIDE = fromString("RouteConfigurationOverride"); + + /** + * Creates or finds a DeliveryRuleActionValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeliveryRuleActionValue. + */ + @JsonCreator + public static DeliveryRuleActionValue fromString(String name) { + return fromString(name, DeliveryRuleActionValue.class); + } + + /** + * Gets known DeliveryRuleActionValue values. + * + * @return known DeliveryRuleActionValue values. + */ + public static Collection values() { + return values(DeliveryRuleActionValue.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java new file mode 100644 index 0000000000000..5da9d35a2804a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the cache expiration action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("CacheExpiration") +@Fluent +public final class DeliveryRuleCacheExpirationAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private CacheExpirationActionParameters parameters; + + /** Creates an instance of DeliveryRuleCacheExpirationAction class. */ + public DeliveryRuleCacheExpirationAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public CacheExpirationActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleCacheExpirationAction object itself. + */ + public DeliveryRuleCacheExpirationAction withParameters(CacheExpirationActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCacheExpirationAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCacheExpirationAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.java new file mode 100644 index 0000000000000..60cf482ca2d8f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the cache-key query string action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("CacheKeyQueryString") +@Fluent +public final class DeliveryRuleCacheKeyQueryStringAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private CacheKeyQueryStringActionParameters parameters; + + /** Creates an instance of DeliveryRuleCacheKeyQueryStringAction class. */ + public DeliveryRuleCacheKeyQueryStringAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public CacheKeyQueryStringActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleCacheKeyQueryStringAction object itself. + */ + public DeliveryRuleCacheKeyQueryStringAction withParameters(CacheKeyQueryStringActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCacheKeyQueryStringAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCacheKeyQueryStringAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.java new file mode 100644 index 0000000000000..ed84e1e7cbb7a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleClientPortCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the ClientPort condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("ClientPort") +@Fluent +public final class DeliveryRuleClientPortCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private ClientPortMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleClientPortCondition class. */ + public DeliveryRuleClientPortCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public ClientPortMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleClientPortCondition object itself. + */ + public DeliveryRuleClientPortCondition withParameters(ClientPortMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleClientPortCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleClientPortCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.java new file mode 100644 index 0000000000000..5bee28d982cb3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** A condition for the delivery rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "name", + defaultImpl = DeliveryRuleCondition.class) +@JsonTypeName("DeliveryRuleCondition") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "RemoteAddress", value = DeliveryRuleRemoteAddressCondition.class), + @JsonSubTypes.Type(name = "RequestMethod", value = DeliveryRuleRequestMethodCondition.class), + @JsonSubTypes.Type(name = "QueryString", value = DeliveryRuleQueryStringCondition.class), + @JsonSubTypes.Type(name = "PostArgs", value = DeliveryRulePostArgsCondition.class), + @JsonSubTypes.Type(name = "RequestUri", value = DeliveryRuleRequestUriCondition.class), + @JsonSubTypes.Type(name = "RequestHeader", value = DeliveryRuleRequestHeaderCondition.class), + @JsonSubTypes.Type(name = "RequestBody", value = DeliveryRuleRequestBodyCondition.class), + @JsonSubTypes.Type(name = "RequestScheme", value = DeliveryRuleRequestSchemeCondition.class), + @JsonSubTypes.Type(name = "UrlPath", value = DeliveryRuleUrlPathCondition.class), + @JsonSubTypes.Type(name = "UrlFileExtension", value = DeliveryRuleUrlFileExtensionCondition.class), + @JsonSubTypes.Type(name = "UrlFileName", value = DeliveryRuleUrlFileNameCondition.class), + @JsonSubTypes.Type(name = "HttpVersion", value = DeliveryRuleHttpVersionCondition.class), + @JsonSubTypes.Type(name = "Cookies", value = DeliveryRuleCookiesCondition.class), + @JsonSubTypes.Type(name = "IsDevice", value = DeliveryRuleIsDeviceCondition.class), + @JsonSubTypes.Type(name = "SocketAddr", value = DeliveryRuleSocketAddrCondition.class), + @JsonSubTypes.Type(name = "ClientPort", value = DeliveryRuleClientPortCondition.class), + @JsonSubTypes.Type(name = "ServerPort", value = DeliveryRuleServerPortCondition.class), + @JsonSubTypes.Type(name = "HostName", value = DeliveryRuleHostnameCondition.class), + @JsonSubTypes.Type(name = "SslProtocol", value = DeliveryRuleSslProtocolCondition.class) +}) +@Immutable +public class DeliveryRuleCondition { + /** Creates an instance of DeliveryRuleCondition class. */ + public DeliveryRuleCondition() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.java new file mode 100644 index 0000000000000..41f450fe04a82 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the Cookies condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("Cookies") +@Fluent +public final class DeliveryRuleCookiesCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private CookiesMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleCookiesCondition class. */ + public DeliveryRuleCookiesCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public CookiesMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleCookiesCondition object itself. + */ + public DeliveryRuleCookiesCondition withParameters(CookiesMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleCookiesCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleCookiesCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.java new file mode 100644 index 0000000000000..0fba0448fad86 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHostnameCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the HostName condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("HostName") +@Fluent +public final class DeliveryRuleHostnameCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private HostnameMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleHostnameCondition class. */ + public DeliveryRuleHostnameCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public HostnameMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleHostnameCondition object itself. + */ + public DeliveryRuleHostnameCondition withParameters(HostnameMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleHostnameCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleHostnameCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.java new file mode 100644 index 0000000000000..acfa0cd79464a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the HttpVersion condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("HttpVersion") +@Fluent +public final class DeliveryRuleHttpVersionCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private HttpVersionMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleHttpVersionCondition class. */ + public DeliveryRuleHttpVersionCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public HttpVersionMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleHttpVersionCondition object itself. + */ + public DeliveryRuleHttpVersionCondition withParameters(HttpVersionMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleHttpVersionCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleHttpVersionCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.java new file mode 100644 index 0000000000000..971c8c54d98b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the IsDevice condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("IsDevice") +@Fluent +public final class DeliveryRuleIsDeviceCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private IsDeviceMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleIsDeviceCondition class. */ + public DeliveryRuleIsDeviceCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public IsDeviceMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleIsDeviceCondition object itself. + */ + public DeliveryRuleIsDeviceCondition withParameters(IsDeviceMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleIsDeviceCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleIsDeviceCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.java new file mode 100644 index 0000000000000..7bc5f728930c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the PostArgs condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("PostArgs") +@Fluent +public final class DeliveryRulePostArgsCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private PostArgsMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRulePostArgsCondition class. */ + public DeliveryRulePostArgsCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public PostArgsMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRulePostArgsCondition object itself. + */ + public DeliveryRulePostArgsCondition withParameters(PostArgsMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRulePostArgsCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRulePostArgsCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.java new file mode 100644 index 0000000000000..688c0ea0a8e98 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the QueryString condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("QueryString") +@Fluent +public final class DeliveryRuleQueryStringCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private QueryStringMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleQueryStringCondition class. */ + public DeliveryRuleQueryStringCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public QueryStringMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleQueryStringCondition object itself. + */ + public DeliveryRuleQueryStringCondition withParameters(QueryStringMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleQueryStringCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleQueryStringCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.java new file mode 100644 index 0000000000000..6b343ff2599ea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RemoteAddress condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RemoteAddress") +@Fluent +public final class DeliveryRuleRemoteAddressCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RemoteAddressMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRemoteAddressCondition class. */ + public DeliveryRuleRemoteAddressCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RemoteAddressMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRemoteAddressCondition object itself. + */ + public DeliveryRuleRemoteAddressCondition withParameters(RemoteAddressMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRemoteAddressCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRemoteAddressCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.java new file mode 100644 index 0000000000000..fba1dac757291 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RequestBody condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RequestBody") +@Fluent +public final class DeliveryRuleRequestBodyCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestBodyMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestBodyCondition class. */ + public DeliveryRuleRequestBodyCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RequestBodyMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestBodyCondition object itself. + */ + public DeliveryRuleRequestBodyCondition withParameters(RequestBodyMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestBodyCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestBodyCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.java new file mode 100644 index 0000000000000..0401b7de46da1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the request header action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("ModifyRequestHeader") +@Fluent +public final class DeliveryRuleRequestHeaderAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private HeaderActionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestHeaderAction class. */ + public DeliveryRuleRequestHeaderAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public HeaderActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestHeaderAction object itself. + */ + public DeliveryRuleRequestHeaderAction withParameters(HeaderActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestHeaderAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestHeaderAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.java new file mode 100644 index 0000000000000..49cae60ee6235 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RequestHeader condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RequestHeader") +@Fluent +public final class DeliveryRuleRequestHeaderCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestHeaderMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestHeaderCondition class. */ + public DeliveryRuleRequestHeaderCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RequestHeaderMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestHeaderCondition object itself. + */ + public DeliveryRuleRequestHeaderCondition withParameters(RequestHeaderMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestHeaderCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestHeaderCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.java new file mode 100644 index 0000000000000..793004e45e31a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RequestMethod condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RequestMethod") +@Fluent +public final class DeliveryRuleRequestMethodCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestMethodMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestMethodCondition class. */ + public DeliveryRuleRequestMethodCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RequestMethodMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestMethodCondition object itself. + */ + public DeliveryRuleRequestMethodCondition withParameters(RequestMethodMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestMethodCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestMethodCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.java new file mode 100644 index 0000000000000..23774a9c82031 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RequestScheme condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RequestScheme") +@Fluent +public final class DeliveryRuleRequestSchemeCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestSchemeMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestSchemeCondition class. */ + public DeliveryRuleRequestSchemeCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RequestSchemeMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestSchemeCondition object itself. + */ + public DeliveryRuleRequestSchemeCondition withParameters(RequestSchemeMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestSchemeCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestSchemeCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.java new file mode 100644 index 0000000000000..e96cbc89e80c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the RequestUri condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RequestUri") +@Fluent +public final class DeliveryRuleRequestUriCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestUriMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleRequestUriCondition class. */ + public DeliveryRuleRequestUriCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public RequestUriMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRequestUriCondition object itself. + */ + public DeliveryRuleRequestUriCondition withParameters(RequestUriMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRequestUriCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRequestUriCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.java new file mode 100644 index 0000000000000..cd985558d68f9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the response header action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("ModifyResponseHeader") +@Fluent +public final class DeliveryRuleResponseHeaderAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private HeaderActionParameters parameters; + + /** Creates an instance of DeliveryRuleResponseHeaderAction class. */ + public DeliveryRuleResponseHeaderAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public HeaderActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleResponseHeaderAction object itself. + */ + public DeliveryRuleResponseHeaderAction withParameters(HeaderActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleResponseHeaderAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleResponseHeaderAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.java new file mode 100644 index 0000000000000..989bb8f1b9b94 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRouteConfigurationOverrideAction.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the route configuration override action for the delivery rule. Only applicable to Frontdoor Standard/Premium + * Profiles. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("RouteConfigurationOverride") +@Fluent +public final class DeliveryRuleRouteConfigurationOverrideAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private RouteConfigurationOverrideActionParameters parameters; + + /** Creates an instance of DeliveryRuleRouteConfigurationOverrideAction class. */ + public DeliveryRuleRouteConfigurationOverrideAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public RouteConfigurationOverrideActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleRouteConfigurationOverrideAction object itself. + */ + public DeliveryRuleRouteConfigurationOverrideAction withParameters( + RouteConfigurationOverrideActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleRouteConfigurationOverrideAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleRouteConfigurationOverrideAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java new file mode 100644 index 0000000000000..f6b03937683b3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleServerPortCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the ServerPort condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("ServerPort") +@Fluent +public final class DeliveryRuleServerPortCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private ServerPortMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleServerPortCondition class. */ + public DeliveryRuleServerPortCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public ServerPortMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleServerPortCondition object itself. + */ + public DeliveryRuleServerPortCondition withParameters(ServerPortMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleServerPortCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleServerPortCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java new file mode 100644 index 0000000000000..5c4bbd904e409 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSocketAddrCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the SocketAddress condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("SocketAddr") +@Fluent +public final class DeliveryRuleSocketAddrCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private SocketAddrMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleSocketAddrCondition class. */ + public DeliveryRuleSocketAddrCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public SocketAddrMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleSocketAddrCondition object itself. + */ + public DeliveryRuleSocketAddrCondition withParameters(SocketAddrMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleSocketAddrCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleSocketAddrCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.java new file mode 100644 index 0000000000000..427f74940b527 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleSslProtocolCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the SslProtocol condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("SslProtocol") +@Fluent +public final class DeliveryRuleSslProtocolCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private SslProtocolMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleSslProtocolCondition class. */ + public DeliveryRuleSslProtocolCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public SslProtocolMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleSslProtocolCondition object itself. + */ + public DeliveryRuleSslProtocolCondition withParameters(SslProtocolMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleSslProtocolCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleSslProtocolCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.java new file mode 100644 index 0000000000000..71ac8eda67856 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the UrlFileExtension condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlFileExtension") +@Fluent +public final class DeliveryRuleUrlFileExtensionCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlFileExtensionMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleUrlFileExtensionCondition class. */ + public DeliveryRuleUrlFileExtensionCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public UrlFileExtensionMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleUrlFileExtensionCondition object itself. + */ + public DeliveryRuleUrlFileExtensionCondition withParameters(UrlFileExtensionMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlFileExtensionCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlFileExtensionCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.java new file mode 100644 index 0000000000000..b80a2b94f10cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the UrlFileName condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlFileName") +@Fluent +public final class DeliveryRuleUrlFileNameCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlFileNameMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleUrlFileNameCondition class. */ + public DeliveryRuleUrlFileNameCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public UrlFileNameMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleUrlFileNameCondition object itself. + */ + public DeliveryRuleUrlFileNameCondition withParameters(UrlFileNameMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlFileNameCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlFileNameCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.java new file mode 100644 index 0000000000000..4ac365cc847b0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the UrlPath condition for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlPath") +@Fluent +public final class DeliveryRuleUrlPathCondition extends DeliveryRuleCondition { + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlPathMatchConditionParameters parameters; + + /** Creates an instance of DeliveryRuleUrlPathCondition class. */ + public DeliveryRuleUrlPathCondition() { + } + + /** + * Get the parameters property: Defines the parameters for the condition. + * + * @return the parameters value. + */ + public UrlPathMatchConditionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the condition. + * + * @param parameters the parameters value to set. + * @return the DeliveryRuleUrlPathCondition object itself. + */ + public DeliveryRuleUrlPathCondition withParameters(UrlPathMatchConditionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model DeliveryRuleUrlPathCondition")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeliveryRuleUrlPathCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.java new file mode 100644 index 0000000000000..2a777f8862398 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentStatus. */ +public final class DeploymentStatus extends ExpandableStringEnum { + /** Static value NotStarted for DeploymentStatus. */ + public static final DeploymentStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for DeploymentStatus. */ + public static final DeploymentStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for DeploymentStatus. */ + public static final DeploymentStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DeploymentStatus. */ + public static final DeploymentStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a DeploymentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentStatus. + */ + @JsonCreator + public static DeploymentStatus fromString(String name) { + return fromString(name, DeploymentStatus.class); + } + + /** + * Gets known DeploymentStatus values. + * + * @return known DeploymentStatus values. + */ + public static Collection values() { + return values(DeploymentStatus.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java new file mode 100644 index 0000000000000..7238783377fa3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Protocol to use for the redirect. The default value is MatchRequest. */ +public final class DestinationProtocol extends ExpandableStringEnum { + /** Static value MatchRequest for DestinationProtocol. */ + public static final DestinationProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** Static value Http for DestinationProtocol. */ + public static final DestinationProtocol HTTP = fromString("Http"); + + /** Static value Https for DestinationProtocol. */ + public static final DestinationProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a DestinationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationProtocol. + */ + @JsonCreator + public static DestinationProtocol fromString(String name) { + return fromString(name, DestinationProtocol.class); + } + + /** + * Gets known DestinationProtocol values. + * + * @return known DestinationProtocol values. + */ + public static Collection values() { + return values(DestinationProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.java new file mode 100644 index 0000000000000..f5116ba78eb59 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DimensionProperties.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Type of operation: get, read, delete, etc. */ +@Fluent +public final class DimensionProperties { + /* + * Name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Internal name of dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** Creates an instance of DimensionProperties class. */ + public DimensionProperties() { + } + + /** + * Get the name property: Name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of dimension. + * + * @param name the name value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of dimension. + * + * @param displayName the displayName value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: Internal name of dimension. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: Internal name of dimension. + * + * @param internalName the internalName value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationProperties.java new file mode 100644 index 0000000000000..48e005ffbe60e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationProperties.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to validate a domain. */ +@Immutable +public final class DomainValidationProperties { + /* + * Challenge used for DNS TXT record or file based validation + */ + @JsonProperty(value = "validationToken", access = JsonProperty.Access.WRITE_ONLY) + private String validationToken; + + /* + * The date time that the token expires + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /** Creates an instance of DomainValidationProperties class. */ + public DomainValidationProperties() { + } + + /** + * Get the validationToken property: Challenge used for DNS TXT record or file based validation. + * + * @return the validationToken value. + */ + public String validationToken() { + return this.validationToken; + } + + /** + * Get the expirationDate property: The date time that the token expires. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.java new file mode 100644 index 0000000000000..85408f52fb9c5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for + * DomainControlValidation. + */ +public final class DomainValidationState extends ExpandableStringEnum { + /** Static value Unknown for DomainValidationState. */ + public static final DomainValidationState UNKNOWN = fromString("Unknown"); + + /** Static value Submitting for DomainValidationState. */ + public static final DomainValidationState SUBMITTING = fromString("Submitting"); + + /** Static value Pending for DomainValidationState. */ + public static final DomainValidationState PENDING = fromString("Pending"); + + /** Static value Rejected for DomainValidationState. */ + public static final DomainValidationState REJECTED = fromString("Rejected"); + + /** Static value TimedOut for DomainValidationState. */ + public static final DomainValidationState TIMED_OUT = fromString("TimedOut"); + + /** Static value PendingRevalidation for DomainValidationState. */ + public static final DomainValidationState PENDING_REVALIDATION = fromString("PendingRevalidation"); + + /** Static value Approved for DomainValidationState. */ + public static final DomainValidationState APPROVED = fromString("Approved"); + + /** Static value RefreshingValidationToken for DomainValidationState. */ + public static final DomainValidationState REFRESHING_VALIDATION_TOKEN = fromString("RefreshingValidationToken"); + + /** Static value InternalError for DomainValidationState. */ + public static final DomainValidationState INTERNAL_ERROR = fromString("InternalError"); + + /** + * Creates or finds a DomainValidationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainValidationState. + */ + @JsonCreator + public static DomainValidationState fromString(String name) { + return fromString(name, DomainValidationState.class); + } + + /** + * Gets known DomainValidationState values. + * + * @return known DomainValidationState values. + */ + public static Collection values() { + return values(DomainValidationState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.java new file mode 100644 index 0000000000000..76f351e1dff31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.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.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import java.util.List; + +/** An immutable client-side representation of EdgeNode. */ +public interface EdgeNode { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + List ipAddressGroups(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner object. + * + * @return the inner object. + */ + EdgeNodeInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java new file mode 100644 index 0000000000000..4e61e2dd2811a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of EdgeNodes. */ +public interface EdgeNodes { + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN edgenodes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java new file mode 100644 index 0000000000000..a1ff24b752be6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next + * set of results. + */ +@Fluent +public final class EdgenodeResult { + /* + * Edge node of CDN service. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of edgenode list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EdgenodeResult class. */ + public EdgenodeResult() { + } + + /** + * Get the value property: Edge node of CDN service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of edgenode list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of edgenode list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the EdgenodeResult object itself. + */ + public EdgenodeResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.java new file mode 100644 index 0000000000000..3d67b50125e0b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. */ +public final class EnabledState extends ExpandableStringEnum { + /** Static value Enabled for EnabledState. */ + public static final EnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnabledState. */ + public static final EnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledState. + */ + @JsonCreator + public static EnabledState fromString(String name) { + return fromString(name, EnabledState.class); + } + + /** + * Gets known EnabledState values. + * + * @return known EnabledState values. + */ + public static Collection values() { + return values(EnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java new file mode 100644 index 0000000000000..72c95c21ba9ea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java @@ -0,0 +1,919 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Endpoint. */ +public interface Endpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the hostname property: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + * contoso.azureedge.net. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the origins property: The source of the content being delivered via CDN. + * + * @return the origins value. + */ + List origins(); + + /** + * Gets the originGroups property: The origin groups comprising of origins that are used for load balancing the + * traffic based on availability. + * + * @return the originGroups value. + */ + List originGroups(); + + /** + * Gets the customDomains property: The custom domains under the endpoint. + * + * @return the customDomains value. + */ + List customDomains(); + + /** + * Gets the resourceState property: Resource status of the endpoint. + * + * @return the resourceState value. + */ + EndpointResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the endpoint. + * + * @return the provisioningState value. + */ + EndpointProvisioningState provisioningState(); + + /** + * Gets the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + String originPath(); + + /** + * Gets the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + List contentTypesToCompress(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + Boolean isCompressionEnabled(); + + /** + * Gets the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + Boolean isHttpAllowed(); + + /** + * Gets the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + Boolean isHttpsAllowed(); + + /** + * Gets the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + QueryStringCachingBehavior queryStringCachingBehavior(); + + /** + * Gets the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + OptimizationType optimizationType(); + + /** + * Gets the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + String probePath(); + + /** + * Gets the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + List geoFilters(); + + /** + * Gets the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + ResourceReference defaultOriginGroup(); + + /** + * Gets the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + List urlSigningKeys(); + + /** + * Gets the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy(); + + /** + * Gets the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink(); + + /** + * 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.cdn.generated.fluent.models.EndpointInner object. + * + * @return the inner object. + */ + EndpointInner innerModel(); + + /** The entirety of the Endpoint definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Endpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the Endpoint definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Endpoint definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Endpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the Endpoint 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.WithOrigins, + DefinitionStages.WithOriginGroups, + DefinitionStages.WithOriginPath, + DefinitionStages.WithContentTypesToCompress, + DefinitionStages.WithOriginHostHeader, + DefinitionStages.WithIsCompressionEnabled, + DefinitionStages.WithIsHttpAllowed, + DefinitionStages.WithIsHttpsAllowed, + DefinitionStages.WithQueryStringCachingBehavior, + DefinitionStages.WithOptimizationType, + DefinitionStages.WithProbePath, + DefinitionStages.WithGeoFilters, + DefinitionStages.WithDefaultOriginGroup, + DefinitionStages.WithUrlSigningKeys, + DefinitionStages.WithDeliveryPolicy, + DefinitionStages.WithWebApplicationFirewallPolicyLink { + /** + * Executes the create request. + * + * @return the created resource. + */ + Endpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Endpoint create(Context context); + } + /** The stage of the Endpoint 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 Endpoint definition allowing to specify origins. */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN.. + * + * @param origins The source of the content being delivered via CDN. + * @return the next definition stage. + */ + WithCreate withOrigins(List origins); + } + /** The stage of the Endpoint definition allowing to specify originGroups. */ + interface WithOriginGroups { + /** + * Specifies the originGroups property: The origin groups comprising of origins that are used for load + * balancing the traffic based on availability.. + * + * @param originGroups The origin groups comprising of origins that are used for load balancing the traffic + * based on availability. + * @return the next definition stage. + */ + WithCreate withOriginGroups(List originGroups); + } + /** The stage of the Endpoint definition allowing to specify originPath. */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + WithCreate withOriginPath(String originPath); + } + /** The stage of the Endpoint definition allowing to specify contentTypesToCompress. */ + interface WithContentTypesToCompress { + /** + * Specifies the contentTypesToCompress property: List of content types on which compression applies. The + * value should be a valid MIME type.. + * + * @param contentTypesToCompress List of content types on which compression applies. The value should be a + * valid MIME type. + * @return the next definition stage. + */ + WithCreate withContentTypesToCompress(List contentTypesToCompress); + } + /** The stage of the Endpoint definition allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. This + * property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same + * property specified at origin.If you leave this blank, the request hostname determines this value. Azure + * CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default.. + * + * @param originHostHeader The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property + * specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + /** The stage of the Endpoint definition allowing to specify isCompressionEnabled. */ + interface WithIsCompressionEnabled { + /** + * Specifies the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. + * Default value is false. If compression is enabled, content will be served as compressed if user requests + * for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 + * byte or larger than 1 MB.. + * + * @param isCompressionEnabled Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte + * or larger than 1 MB. + * @return the next definition stage. + */ + WithCreate withIsCompressionEnabled(Boolean isCompressionEnabled); + } + /** The stage of the Endpoint definition allowing to specify isHttpAllowed. */ + interface WithIsHttpAllowed { + /** + * Specifies the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpAllowed Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At + * least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + WithCreate withIsHttpAllowed(Boolean isHttpAllowed); + } + /** The stage of the Endpoint definition allowing to specify isHttpsAllowed. */ + interface WithIsHttpsAllowed { + /** + * Specifies the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. + * Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpsAllowed Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + WithCreate withIsHttpsAllowed(Boolean isHttpsAllowed); + } + /** The stage of the Endpoint definition allowing to specify queryStringCachingBehavior. */ + interface WithQueryStringCachingBehavior { + /** + * Specifies the queryStringCachingBehavior property: Defines how CDN caches requests that include query + * strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain + * query strings from being cached, or cache every request with a unique URL.. + * + * @param queryStringCachingBehavior Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings + * from being cached, or cache every request with a unique URL. + * @return the next definition stage. + */ + WithCreate withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior); + } + /** The stage of the Endpoint definition allowing to specify optimizationType. */ + interface WithOptimizationType { + /** + * Specifies the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to + * optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven + * optimization.. + * + * @param optimizationType Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * @return the next definition stage. + */ + WithCreate withOptimizationType(OptimizationType optimizationType); + } + /** The stage of the Endpoint definition allowing to specify probePath. */ + interface WithProbePath { + /** + * Specifies the probePath property: Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin + * path. This property is only relevant when using a single origin.. + * + * @param probePath Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This + * property is only relevant when using a single origin. + * @return the next definition stage. + */ + WithCreate withProbePath(String probePath); + } + /** The stage of the Endpoint definition allowing to specify geoFilters. */ + interface WithGeoFilters { + /** + * Specifies the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. + * Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path + * /pictures/. + * + * @param geoFilters List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * @return the next definition stage. + */ + WithCreate withGeoFilters(List geoFilters); + } + /** The stage of the Endpoint definition allowing to specify defaultOriginGroup. */ + interface WithDefaultOriginGroup { + /** + * Specifies the defaultOriginGroup property: A reference to the origin group.. + * + * @param defaultOriginGroup A reference to the origin group. + * @return the next definition stage. + */ + WithCreate withDefaultOriginGroup(ResourceReference defaultOriginGroup); + } + /** The stage of the Endpoint definition allowing to specify urlSigningKeys. */ + interface WithUrlSigningKeys { + /** + * Specifies the urlSigningKeys property: List of keys used to validate the signed URL hashes.. + * + * @param urlSigningKeys List of keys used to validate the signed URL hashes. + * @return the next definition stage. + */ + WithCreate withUrlSigningKeys(List urlSigningKeys); + } + /** The stage of the Endpoint definition allowing to specify deliveryPolicy. */ + interface WithDeliveryPolicy { + /** + * Specifies the deliveryPolicy property: A policy that specifies the delivery rules to be used for an + * endpoint.. + * + * @param deliveryPolicy A policy that specifies the delivery rules to be used for an endpoint. + * @return the next definition stage. + */ + WithCreate withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy); + } + /** The stage of the Endpoint definition allowing to specify webApplicationFirewallPolicyLink. */ + interface WithWebApplicationFirewallPolicyLink { + /** + * Specifies the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for + * the endpoint (if applicable). + * + * @param webApplicationFirewallPolicyLink Defines the Web Application Firewall policy for the endpoint (if + * applicable). + * @return the next definition stage. + */ + WithCreate withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink); + } + } + /** + * Begins update for the Endpoint resource. + * + * @return the stage of resource update. + */ + Endpoint.Update update(); + + /** The template for Endpoint update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithOriginPath, + UpdateStages.WithContentTypesToCompress, + UpdateStages.WithOriginHostHeader, + UpdateStages.WithIsCompressionEnabled, + UpdateStages.WithIsHttpAllowed, + UpdateStages.WithIsHttpsAllowed, + UpdateStages.WithQueryStringCachingBehavior, + UpdateStages.WithOptimizationType, + UpdateStages.WithProbePath, + UpdateStages.WithGeoFilters, + UpdateStages.WithDefaultOriginGroup, + UpdateStages.WithUrlSigningKeys, + UpdateStages.WithDeliveryPolicy, + UpdateStages.WithWebApplicationFirewallPolicyLink { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Endpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Endpoint apply(Context context); + } + /** The Endpoint update stages. */ + interface UpdateStages { + /** The stage of the Endpoint update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Endpoint tags.. + * + * @param tags Endpoint tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Endpoint update allowing to specify originPath. */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + Update withOriginPath(String originPath); + } + /** The stage of the Endpoint update allowing to specify contentTypesToCompress. */ + interface WithContentTypesToCompress { + /** + * Specifies the contentTypesToCompress property: List of content types on which compression applies. The + * value should be a valid MIME type.. + * + * @param contentTypesToCompress List of content types on which compression applies. The value should be a + * valid MIME type. + * @return the next definition stage. + */ + Update withContentTypesToCompress(List contentTypesToCompress); + } + /** The stage of the Endpoint update allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. This + * property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same + * property specified at origin.If you leave this blank, the request hostname determines this value. Azure + * CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default.. + * + * @param originHostHeader The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property + * specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN + * origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match + * the origin hostname by default. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + /** The stage of the Endpoint update allowing to specify isCompressionEnabled. */ + interface WithIsCompressionEnabled { + /** + * Specifies the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. + * Default value is false. If compression is enabled, content will be served as compressed if user requests + * for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 + * byte or larger than 1 MB.. + * + * @param isCompressionEnabled Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a + * compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte + * or larger than 1 MB. + * @return the next definition stage. + */ + Update withIsCompressionEnabled(Boolean isCompressionEnabled); + } + /** The stage of the Endpoint update allowing to specify isHttpAllowed. */ + interface WithIsHttpAllowed { + /** + * Specifies the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default + * value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpAllowed Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At + * least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + Update withIsHttpAllowed(Boolean isHttpAllowed); + } + /** The stage of the Endpoint update allowing to specify isHttpsAllowed. */ + interface WithIsHttpsAllowed { + /** + * Specifies the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. + * Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.. + * + * @param isHttpsAllowed Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * @return the next definition stage. + */ + Update withIsHttpsAllowed(Boolean isHttpsAllowed); + } + /** The stage of the Endpoint update allowing to specify queryStringCachingBehavior. */ + interface WithQueryStringCachingBehavior { + /** + * Specifies the queryStringCachingBehavior property: Defines how CDN caches requests that include query + * strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain + * query strings from being cached, or cache every request with a unique URL.. + * + * @param queryStringCachingBehavior Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings + * from being cached, or cache every request with a unique URL. + * @return the next definition stage. + */ + Update withQueryStringCachingBehavior(QueryStringCachingBehavior queryStringCachingBehavior); + } + /** The stage of the Endpoint update allowing to specify optimizationType. */ + interface WithOptimizationType { + /** + * Specifies the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to + * optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven + * optimization.. + * + * @param optimizationType Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * @return the next definition stage. + */ + Update withOptimizationType(OptimizationType optimizationType); + } + /** The stage of the Endpoint update allowing to specify probePath. */ + interface WithProbePath { + /** + * Specifies the probePath property: Path to a file hosted on the origin which helps accelerate delivery of + * the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin + * path. This property is only relevant when using a single origin.. + * + * @param probePath Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This + * property is only relevant when using a single origin. + * @return the next definition stage. + */ + Update withProbePath(String probePath); + } + /** The stage of the Endpoint update allowing to specify geoFilters. */ + interface WithGeoFilters { + /** + * Specifies the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. + * Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path + * /pictures/. + * + * @param geoFilters List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * @return the next definition stage. + */ + Update withGeoFilters(List geoFilters); + } + /** The stage of the Endpoint update allowing to specify defaultOriginGroup. */ + interface WithDefaultOriginGroup { + /** + * Specifies the defaultOriginGroup property: A reference to the origin group.. + * + * @param defaultOriginGroup A reference to the origin group. + * @return the next definition stage. + */ + Update withDefaultOriginGroup(ResourceReference defaultOriginGroup); + } + /** The stage of the Endpoint update allowing to specify urlSigningKeys. */ + interface WithUrlSigningKeys { + /** + * Specifies the urlSigningKeys property: List of keys used to validate the signed URL hashes.. + * + * @param urlSigningKeys List of keys used to validate the signed URL hashes. + * @return the next definition stage. + */ + Update withUrlSigningKeys(List urlSigningKeys); + } + /** The stage of the Endpoint update allowing to specify deliveryPolicy. */ + interface WithDeliveryPolicy { + /** + * Specifies the deliveryPolicy property: A policy that specifies the delivery rules to be used for an + * endpoint.. + * + * @param deliveryPolicy A policy that specifies the delivery rules to be used for an endpoint. + * @return the next definition stage. + */ + Update withDeliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy); + } + /** The stage of the Endpoint update allowing to specify webApplicationFirewallPolicyLink. */ + interface WithWebApplicationFirewallPolicyLink { + /** + * Specifies the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for + * the endpoint (if applicable). + * + * @param webApplicationFirewallPolicyLink Defines the Web Application Firewall policy for the endpoint (if + * applicable). + * @return the next definition stage. + */ + Update withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Endpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Endpoint refresh(Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(); + + /** + * Stops an existing running CDN endpoint. + * + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(Context context); + + /** + * Removes a content from CDN. + * + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent(PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @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 purgeContent(PurgeParameters contentFilePaths, Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadContent(LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @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 loadContent(LoadParameters contentFilePaths, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java new file mode 100644 index 0000000000000..66d2eed4116a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class EndpointListResult { + /* + * List of CDN endpoints within a profile + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of endpoint objects if there is any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EndpointListResult class. */ + public EndpointListResult() { + } + + /** + * Get the value property: List of CDN endpoints within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of endpoint objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the EndpointListResult object itself. + */ + public EndpointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.java new file mode 100644 index 0000000000000..1c76933836898 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A policy that specifies the delivery rules to be used for an endpoint. */ +@Fluent +public final class EndpointPropertiesUpdateParametersDeliveryPolicy { + /* + * User-friendly description of the policy. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A list of the delivery rules. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** Creates an instance of EndpointPropertiesUpdateParametersDeliveryPolicy class. */ + public EndpointPropertiesUpdateParametersDeliveryPolicy() { + } + + /** + * Get the description property: User-friendly description of the policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-friendly description of the policy. + * + * @param description the description value to set. + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules property: A list of the delivery rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A list of the delivery rules. + * + * @param rules the rules value to set. + * @return the EndpointPropertiesUpdateParametersDeliveryPolicy object itself. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rules in model EndpointPropertiesUpdateParametersDeliveryPolicy")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointPropertiesUpdateParametersDeliveryPolicy.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.java new file mode 100644 index 0000000000000..83ee2b62fa4ae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Web Application Firewall policy for the endpoint (if applicable). */ +@Fluent +public final class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink class. */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink object itself. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java new file mode 100644 index 0000000000000..3d6c7ac626294 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the endpoint. */ +public final class EndpointProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for EndpointProvisioningState. */ + public static final EndpointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for EndpointProvisioningState. */ + public static final EndpointProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for EndpointProvisioningState. */ + public static final EndpointProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for EndpointProvisioningState. */ + public static final EndpointProvisioningState DELETING = fromString("Deleting"); + + /** Static value Creating for EndpointProvisioningState. */ + public static final EndpointProvisioningState CREATING = fromString("Creating"); + + /** + * Creates or finds a EndpointProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointProvisioningState. + */ + @JsonCreator + public static EndpointProvisioningState fromString(String name) { + return fromString(name, EndpointProvisioningState.class); + } + + /** + * Gets known EndpointProvisioningState values. + * + * @return known EndpointProvisioningState values. + */ + public static Collection values() { + return values(EndpointProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java new file mode 100644 index 0000000000000..5c7a53ffd1890 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the endpoint. */ +public final class EndpointResourceState extends ExpandableStringEnum { + /** Static value Creating for EndpointResourceState. */ + public static final EndpointResourceState CREATING = fromString("Creating"); + + /** Static value Deleting for EndpointResourceState. */ + public static final EndpointResourceState DELETING = fromString("Deleting"); + + /** Static value Running for EndpointResourceState. */ + public static final EndpointResourceState RUNNING = fromString("Running"); + + /** Static value Starting for EndpointResourceState. */ + public static final EndpointResourceState STARTING = fromString("Starting"); + + /** Static value Stopped for EndpointResourceState. */ + public static final EndpointResourceState STOPPED = fromString("Stopped"); + + /** Static value Stopping for EndpointResourceState. */ + public static final EndpointResourceState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a EndpointResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointResourceState. + */ + @JsonCreator + public static EndpointResourceState fromString(String name) { + return fromString(name, EndpointResourceState.class); + } + + /** + * Gets known EndpointResourceState values. + * + * @return known EndpointResourceState values. + */ + public static Collection values() { + return values(EndpointResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java new file mode 100644 index 0000000000000..5da4d692c194e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties required to create or update an endpoint. */ +@Fluent +public final class EndpointUpdateParameters { + /* + * Endpoint tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The JSON object containing endpoint update parameters. + */ + @JsonProperty(value = "properties") + private EndpointPropertiesUpdateParameters innerProperties; + + /** Creates an instance of EndpointUpdateParameters class. */ + public EndpointUpdateParameters() { + } + + /** + * Get the tags property: Endpoint tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Endpoint tags. + * + * @param tags the tags value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing endpoint update parameters. + * + * @return the innerProperties value. + */ + private EndpointPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that CDN can use to retrieve content from, e.g. + * contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @return the contentTypesToCompress value. + */ + public List contentTypesToCompress() { + return this.innerProperties() == null ? null : this.innerProperties().contentTypesToCompress(); + } + + /** + * Set the contentTypesToCompress property: List of content types on which compression applies. The value should be + * a valid MIME type. + * + * @param contentTypesToCompress the contentTypesToCompress value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withContentTypesToCompress(List contentTypesToCompress) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withContentTypesToCompress(contentTypesToCompress); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. This property at + * Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at + * origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * + * @param originHostHeader the originHostHeader value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @return the isCompressionEnabled value. + */ + public Boolean isCompressionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isCompressionEnabled(); + } + + /** + * Set the isCompressionEnabled property: Indicates whether content compression is enabled on CDN. Default value is + * false. If compression is enabled, content will be served as compressed if user requests for a compressed version. + * Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + * + * @param isCompressionEnabled the isCompressionEnabled value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsCompressionEnabled(Boolean isCompressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsCompressionEnabled(isCompressionEnabled); + return this; + } + + /** + * Get the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpAllowed value. + */ + public Boolean isHttpAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpAllowed(); + } + + /** + * Set the isHttpAllowed property: Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. + * At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpAllowed the isHttpAllowed value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpAllowed(Boolean isHttpAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsHttpAllowed(isHttpAllowed); + return this; + } + + /** + * Get the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @return the isHttpsAllowed value. + */ + public Boolean isHttpsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().isHttpsAllowed(); + } + + /** + * Set the isHttpsAllowed property: Indicates whether HTTPS traffic is allowed on the endpoint. Default value is + * true. At least one protocol (HTTP or HTTPS) must be allowed. + * + * @param isHttpsAllowed the isHttpsAllowed value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withIsHttpsAllowed(Boolean isHttpsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withIsHttpsAllowed(isHttpsAllowed); + return this; + } + + /** + * Get the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @return the queryStringCachingBehavior value. + */ + public QueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().queryStringCachingBehavior(); + } + + /** + * Set the queryStringCachingBehavior property: Defines how CDN caches requests that include query strings. You can + * ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being + * cached, or cache every request with a unique URL. + * + * @param queryStringCachingBehavior the queryStringCachingBehavior value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withQueryStringCachingBehavior( + QueryStringCachingBehavior queryStringCachingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } + + /** + * Get the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @return the optimizationType value. + */ + public OptimizationType optimizationType() { + return this.innerProperties() == null ? null : this.innerProperties().optimizationType(); + } + + /** + * Set the optimizationType property: Specifies what scenario the customer wants this CDN endpoint to optimize for, + * e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. + * + * @param optimizationType the optimizationType value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withOptimizationType(OptimizationType optimizationType) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withOptimizationType(optimizationType); + return this; + } + + /** + * Get the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.innerProperties() == null ? null : this.innerProperties().probePath(); + } + + /** + * Set the probePath property: Path to a file hosted on the origin which helps accelerate delivery of the dynamic + * content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is + * only relevant when using a single origin. + * + * @param probePath the probePath value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withProbePath(String probePath) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withProbePath(probePath); + return this; + } + + /** + * Get the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @return the geoFilters value. + */ + public List geoFilters() { + return this.innerProperties() == null ? null : this.innerProperties().geoFilters(); + } + + /** + * Set the geoFilters property: List of rules defining the user's geo access within a CDN endpoint. Each geo filter + * defines an access rule to a specified path or content, e.g. block APAC for path /pictures/. + * + * @param geoFilters the geoFilters value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withGeoFilters(List geoFilters) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withGeoFilters(geoFilters); + return this; + } + + /** + * Get the defaultOriginGroup property: A reference to the origin group. + * + * @return the defaultOriginGroup value. + */ + public ResourceReference defaultOriginGroup() { + return this.innerProperties() == null ? null : this.innerProperties().defaultOriginGroup(); + } + + /** + * Set the defaultOriginGroup property: A reference to the origin group. + * + * @param defaultOriginGroup the defaultOriginGroup value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withDefaultOriginGroup(ResourceReference defaultOriginGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withDefaultOriginGroup(defaultOriginGroup); + return this; + } + + /** + * Get the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @return the urlSigningKeys value. + */ + public List urlSigningKeys() { + return this.innerProperties() == null ? null : this.innerProperties().urlSigningKeys(); + } + + /** + * Set the urlSigningKeys property: List of keys used to validate the signed URL hashes. + * + * @param urlSigningKeys the urlSigningKeys value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withUrlSigningKeys(List urlSigningKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withUrlSigningKeys(urlSigningKeys); + return this; + } + + /** + * Get the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @return the deliveryPolicy value. + */ + public EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryPolicy(); + } + + /** + * Set the deliveryPolicy property: A policy that specifies the delivery rules to be used for an endpoint. + * + * @param deliveryPolicy the deliveryPolicy value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withDeliveryPolicy( + EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withDeliveryPolicy(deliveryPolicy); + return this; + } + + /** + * Get the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @return the webApplicationFirewallPolicyLink value. + */ + public EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink() { + return this.innerProperties() == null ? null : this.innerProperties().webApplicationFirewallPolicyLink(); + } + + /** + * Set the webApplicationFirewallPolicyLink property: Defines the Web Application Firewall policy for the endpoint + * (if applicable). + * + * @param webApplicationFirewallPolicyLink the webApplicationFirewallPolicyLink value to set. + * @return the EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + if (this.innerProperties() == null) { + this.innerProperties = new EndpointPropertiesUpdateParameters(); + } + this.innerProperties().withWebApplicationFirewallPolicyLink(webApplicationFirewallPolicyLink); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoints.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoints.java new file mode 100644 index 0000000000000..4b47161da19e4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoints.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Endpoints. */ +public interface Endpoints { + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing CDN endpoints. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + */ + Endpoint get(String resourceGroupName, String profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 profileName, String endpointName, Context context); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(String resourceGroupName, String profileName, String endpointName); + + /** + * Starts an existing CDN endpoint that is on a stopped state. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint start(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(String resourceGroupName, String profileName, String endpointName); + + /** + * Stops an existing running CDN endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 cDN endpoint is the entity within a CDN profile containing configuration information such as origin, + * protocol, content caching and delivery behavior. + */ + Endpoint stop(String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 purgeContent( + String resourceGroupName, String profileName, String endpointName, PurgeParameters contentFilePaths); + + /** + * Removes a content from CDN. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' + * which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders and + * files in the directory. + * @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 purgeContent( + String resourceGroupName, + String profileName, + String endpointName, + PurgeParameters contentFilePaths, + Context context); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 loadContent( + String resourceGroupName, String profileName, String endpointName, LoadParameters contentFilePaths); + + /** + * Pre-loads a content to CDN. Available for Verizon Profiles. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param contentFilePaths The path to the content to be loaded. Path should be a full URL, e.g. + * ‘/pictures/city.png' which loads a single file. + * @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 loadContent( + String resourceGroupName, + String profileName, + String endpointName, + LoadParameters contentFilePaths, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @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 output of custom domain validation along with {@link Response}. + */ + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param customDomainProperties Custom domain to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of custom domain validation. + */ + ValidateCustomDomainOutput validateCustomDomain( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and usage of geo filters and custom domains under the given endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @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 an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Endpoint getById(String id); + + /** + * Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group + * and profile. + * + * @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 an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @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 an existing CDN endpoint with the specified endpoint name under the specified subscription, resource + * group and profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Endpoint resource. + * + * @param name resource name. + * @return the first stage of the new Endpoint definition. + */ + Endpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java new file mode 100644 index 0000000000000..4b170fb8778bb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Protocol this rule will use when forwarding traffic to backends. */ +public final class ForwardingProtocol extends ExpandableStringEnum { + /** Static value HttpOnly for ForwardingProtocol. */ + public static final ForwardingProtocol HTTP_ONLY = fromString("HttpOnly"); + + /** Static value HttpsOnly for ForwardingProtocol. */ + public static final ForwardingProtocol HTTPS_ONLY = fromString("HttpsOnly"); + + /** Static value MatchRequest for ForwardingProtocol. */ + public static final ForwardingProtocol MATCH_REQUEST = fromString("MatchRequest"); + + /** + * Creates or finds a ForwardingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ForwardingProtocol. + */ + @JsonCreator + public static ForwardingProtocol fromString(String name) { + return fromString(name, ForwardingProtocol.class); + } + + /** + * Gets known ForwardingProtocol values. + * + * @return known ForwardingProtocol values. + */ + public static Collection values() { + return values(ForwardingProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java new file mode 100644 index 0000000000000..eb647398e8af2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rules defining user's geo access within a CDN endpoint. */ +@Fluent +public final class GeoFilter { + /* + * Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) + */ + @JsonProperty(value = "relativePath", required = true) + private String relativePath; + + /* + * Action of the geo filter, i.e. allow or block access. + */ + @JsonProperty(value = "action", required = true) + private GeoFilterActions action; + + /* + * Two letter country or region codes defining user country or region access in a geo filter, e.g. AU, MX, US. + */ + @JsonProperty(value = "countryCodes", required = true) + private List countryCodes; + + /** Creates an instance of GeoFilter class. */ + public GeoFilter() { + } + + /** + * Get the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', + * '/mypicture/kitty.jpg', and etc.). + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', + * '/mypicture/kitty.jpg', and etc.). + * + * @param relativePath the relativePath value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the action property: Action of the geo filter, i.e. allow or block access. + * + * @return the action value. + */ + public GeoFilterActions action() { + return this.action; + } + + /** + * Set the action property: Action of the geo filter, i.e. allow or block access. + * + * @param action the action value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withAction(GeoFilterActions action) { + this.action = action; + return this; + } + + /** + * Get the countryCodes property: Two letter country or region codes defining user country or region access in a geo + * filter, e.g. AU, MX, US. + * + * @return the countryCodes value. + */ + public List countryCodes() { + return this.countryCodes; + } + + /** + * Set the countryCodes property: Two letter country or region codes defining user country or region access in a geo + * filter, e.g. AU, MX, US. + * + * @param countryCodes the countryCodes value to set. + * @return the GeoFilter object itself. + */ + public GeoFilter withCountryCodes(List countryCodes) { + this.countryCodes = countryCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (relativePath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property relativePath in model GeoFilter")); + } + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model GeoFilter")); + } + if (countryCodes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property countryCodes in model GeoFilter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GeoFilter.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.java new file mode 100644 index 0000000000000..98d2fa4b59293 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Action of the geo filter, i.e. allow or block access. */ +public enum GeoFilterActions { + /** Enum value Block. */ + BLOCK("Block"), + + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a GeoFilterActions instance. */ + private final String value; + + GeoFilterActions(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GeoFilterActions instance. + * + * @param value the serialized value to parse. + * @return the parsed GeoFilterActions object, or null if unable to parse. + */ + @JsonCreator + public static GeoFilterActions fromString(String value) { + if (value == null) { + return null; + } + GeoFilterActions[] items = GeoFilterActions.values(); + for (GeoFilterActions item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.java new file mode 100644 index 0000000000000..c1b361e5b350d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Action to perform. */ +public final class HeaderAction extends ExpandableStringEnum { + /** Static value Append for HeaderAction. */ + public static final HeaderAction APPEND = fromString("Append"); + + /** Static value Overwrite for HeaderAction. */ + public static final HeaderAction OVERWRITE = fromString("Overwrite"); + + /** Static value Delete for HeaderAction. */ + public static final HeaderAction DELETE = fromString("Delete"); + + /** + * Creates or finds a HeaderAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderAction. + */ + @JsonCreator + public static HeaderAction fromString(String name) { + return fromString(name, HeaderAction.class); + } + + /** + * Gets known HeaderAction values. + * + * @return known HeaderAction values. + */ + public static Collection values() { + return values(HeaderAction.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java new file mode 100644 index 0000000000000..e651f306d3a54 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the request header action. */ +@Fluent +public final class HeaderActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleHeaderActionParameters"; + + /* + * Action to perform + */ + @JsonProperty(value = "headerAction", required = true) + private HeaderAction headerAction; + + /* + * Name of the header to modify + */ + @JsonProperty(value = "headerName", required = true) + private String headerName; + + /* + * Value for the specified action + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of HeaderActionParameters class. */ + public HeaderActionParameters() { + typeName = "DeliveryRuleHeaderActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the HeaderActionParameters object itself. + */ + public HeaderActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the headerAction property: Action to perform. + * + * @return the headerAction value. + */ + public HeaderAction headerAction() { + return this.headerAction; + } + + /** + * Set the headerAction property: Action to perform. + * + * @param headerAction the headerAction value to set. + * @return the HeaderActionParameters object itself. + */ + public HeaderActionParameters withHeaderAction(HeaderAction headerAction) { + this.headerAction = headerAction; + return this; + } + + /** + * Get the headerName property: Name of the header to modify. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: Name of the header to modify. + * + * @param headerName the headerName value to set. + * @return the HeaderActionParameters object itself. + */ + public HeaderActionParameters withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the value property: Value for the specified action. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value for the specified action. + * + * @param value the value value to set. + * @return the HeaderActionParameters object itself. + */ + public HeaderActionParameters withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headerAction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property headerAction in model HeaderActionParameters")); + } + if (headerName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property headerName in model HeaderActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HeaderActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.java new file mode 100644 index 0000000000000..d72bdd824d022 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to send health probes to origin. */ +@Fluent +public final class HealthProbeParameters { + /* + * The path relative to the origin that is used to determine the health of the origin. + */ + @JsonProperty(value = "probePath") + private String probePath; + + /* + * The type of health probe request that is made. + */ + @JsonProperty(value = "probeRequestType") + private HealthProbeRequestType probeRequestType; + + /* + * Protocol to use for health probe. + */ + @JsonProperty(value = "probeProtocol") + private ProbeProtocol probeProtocol; + + /* + * The number of seconds between health probes.Default is 240sec. + */ + @JsonProperty(value = "probeIntervalInSeconds") + private Integer probeIntervalInSeconds; + + /** Creates an instance of HealthProbeParameters class. */ + public HealthProbeParameters() { + } + + /** + * Get the probePath property: The path relative to the origin that is used to determine the health of the origin. + * + * @return the probePath value. + */ + public String probePath() { + return this.probePath; + } + + /** + * Set the probePath property: The path relative to the origin that is used to determine the health of the origin. + * + * @param probePath the probePath value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbePath(String probePath) { + this.probePath = probePath; + return this; + } + + /** + * Get the probeRequestType property: The type of health probe request that is made. + * + * @return the probeRequestType value. + */ + public HealthProbeRequestType probeRequestType() { + return this.probeRequestType; + } + + /** + * Set the probeRequestType property: The type of health probe request that is made. + * + * @param probeRequestType the probeRequestType value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeRequestType(HealthProbeRequestType probeRequestType) { + this.probeRequestType = probeRequestType; + return this; + } + + /** + * Get the probeProtocol property: Protocol to use for health probe. + * + * @return the probeProtocol value. + */ + public ProbeProtocol probeProtocol() { + return this.probeProtocol; + } + + /** + * Set the probeProtocol property: Protocol to use for health probe. + * + * @param probeProtocol the probeProtocol value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeProtocol(ProbeProtocol probeProtocol) { + this.probeProtocol = probeProtocol; + return this; + } + + /** + * Get the probeIntervalInSeconds property: The number of seconds between health probes.Default is 240sec. + * + * @return the probeIntervalInSeconds value. + */ + public Integer probeIntervalInSeconds() { + return this.probeIntervalInSeconds; + } + + /** + * Set the probeIntervalInSeconds property: The number of seconds between health probes.Default is 240sec. + * + * @param probeIntervalInSeconds the probeIntervalInSeconds value to set. + * @return the HealthProbeParameters object itself. + */ + public HealthProbeParameters withProbeIntervalInSeconds(Integer probeIntervalInSeconds) { + this.probeIntervalInSeconds = probeIntervalInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.java new file mode 100644 index 0000000000000..0674699a16644 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of health probe request that is made. */ +public enum HealthProbeRequestType { + /** Enum value NotSet. */ + NOT_SET("NotSet"), + + /** Enum value GET. */ + GET("GET"), + + /** Enum value HEAD. */ + HEAD("HEAD"); + + /** The actual serialized value for a HealthProbeRequestType instance. */ + private final String value; + + HealthProbeRequestType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HealthProbeRequestType instance. + * + * @param value the serialized value to parse. + * @return the parsed HealthProbeRequestType object, or null if unable to parse. + */ + @JsonCreator + public static HealthProbeRequestType fromString(String value) { + if (value == null) { + return null; + } + HealthProbeRequestType[] items = HealthProbeRequestType.values(); + for (HealthProbeRequestType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java new file mode 100644 index 0000000000000..f8280b7db3293 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for HostName match conditions. */ +@Fluent +public final class HostnameMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleHostNameConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private HostnameOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of HostnameMatchConditionParameters class. */ + public HostnameMatchConditionParameters() { + typeName = "DeliveryRuleHostNameConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public HostnameOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withOperator(HostnameOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the HostnameMatchConditionParameters object itself. + */ + public HostnameMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model HostnameMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HostnameMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.java new file mode 100644 index 0000000000000..ab0f819b20573 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HostnameOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class HostnameOperator extends ExpandableStringEnum { + /** Static value Any for HostnameOperator. */ + public static final HostnameOperator ANY = fromString("Any"); + + /** Static value Equal for HostnameOperator. */ + public static final HostnameOperator EQUAL = fromString("Equal"); + + /** Static value Contains for HostnameOperator. */ + public static final HostnameOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for HostnameOperator. */ + public static final HostnameOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for HostnameOperator. */ + public static final HostnameOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for HostnameOperator. */ + public static final HostnameOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for HostnameOperator. */ + public static final HostnameOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for HostnameOperator. */ + public static final HostnameOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for HostnameOperator. */ + public static final HostnameOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for HostnameOperator. */ + public static final HostnameOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a HostnameOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostnameOperator. + */ + @JsonCreator + public static HostnameOperator fromString(String name) { + return fromString(name, HostnameOperator.class); + } + + /** + * Gets known HostnameOperator values. + * + * @return known HostnameOperator values. + */ + public static Collection values() { + return values(HostnameOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java new file mode 100644 index 0000000000000..e1300c6fd87bb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that represents the range for http status codes. */ +@Fluent +public final class HttpErrorRangeParameters { + /* + * The inclusive start of the http status code range. + */ + @JsonProperty(value = "begin") + private Integer begin; + + /* + * The inclusive end of the http status code range. + */ + @JsonProperty(value = "end") + private Integer end; + + /** Creates an instance of HttpErrorRangeParameters class. */ + public HttpErrorRangeParameters() { + } + + /** + * Get the begin property: The inclusive start of the http status code range. + * + * @return the begin value. + */ + public Integer begin() { + return this.begin; + } + + /** + * Set the begin property: The inclusive start of the http status code range. + * + * @param begin the begin value to set. + * @return the HttpErrorRangeParameters object itself. + */ + public HttpErrorRangeParameters withBegin(Integer begin) { + this.begin = begin; + return this; + } + + /** + * Get the end property: The inclusive end of the http status code range. + * + * @return the end value. + */ + public Integer end() { + return this.end; + } + + /** + * Set the end property: The inclusive end of the http status code range. + * + * @param end the end value to set. + * @return the HttpErrorRangeParameters object itself. + */ + public HttpErrorRangeParameters withEnd(Integer end) { + this.end = end; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.java new file mode 100644 index 0000000000000..7388469516cd8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for HttpVersion match conditions. */ +@Fluent +public final class HttpVersionMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleHttpVersionConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private HttpVersionOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of HttpVersionMatchConditionParameters class. */ + public HttpVersionMatchConditionParameters() { + typeName = "DeliveryRuleHttpVersionConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public HttpVersionOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withOperator(HttpVersionOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model HttpVersionMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpVersionMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.java new file mode 100644 index 0000000000000..fbf9d0d6efd1a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class HttpVersionOperator extends ExpandableStringEnum { + /** Static value Equal for HttpVersionOperator. */ + public static final HttpVersionOperator EQUAL = fromString("Equal"); + + /** + * Creates or finds a HttpVersionOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpVersionOperator. + */ + @JsonCreator + public static HttpVersionOperator fromString(String name) { + return fromString(name, HttpVersionOperator.class); + } + + /** + * Gets known HttpVersionOperator values. + * + * @return known HttpVersionOperator values. + */ + public static Collection values() { + return values(HttpVersionOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java new file mode 100644 index 0000000000000..af4486d000e6c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and + * it will be the first rule that gets executed. + */ +public final class HttpsRedirect extends ExpandableStringEnum { + /** Static value Enabled for HttpsRedirect. */ + public static final HttpsRedirect ENABLED = fromString("Enabled"); + + /** Static value Disabled for HttpsRedirect. */ + public static final HttpsRedirect DISABLED = fromString("Disabled"); + + /** + * Creates or finds a HttpsRedirect from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpsRedirect. + */ + @JsonCreator + public static HttpsRedirect fromString(String name) { + return fromString(name, HttpsRedirect.class); + } + + /** + * Gets known HttpsRedirect values. + * + * @return known HttpsRedirect values. + */ + public static Collection values() { + return values(HttpsRedirect.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java new file mode 100644 index 0000000000000..01df848a67c36 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CDN Ip address group. */ +@Fluent +public final class IpAddressGroup { + /* + * The delivery region of the ip address group + */ + @JsonProperty(value = "deliveryRegion") + private String deliveryRegion; + + /* + * The list of ip v4 addresses. + */ + @JsonProperty(value = "ipv4Addresses") + private List ipv4Addresses; + + /* + * The list of ip v6 addresses. + */ + @JsonProperty(value = "ipv6Addresses") + private List ipv6Addresses; + + /** Creates an instance of IpAddressGroup class. */ + public IpAddressGroup() { + } + + /** + * Get the deliveryRegion property: The delivery region of the ip address group. + * + * @return the deliveryRegion value. + */ + public String deliveryRegion() { + return this.deliveryRegion; + } + + /** + * Set the deliveryRegion property: The delivery region of the ip address group. + * + * @param deliveryRegion the deliveryRegion value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withDeliveryRegion(String deliveryRegion) { + this.deliveryRegion = deliveryRegion; + return this; + } + + /** + * Get the ipv4Addresses property: The list of ip v4 addresses. + * + * @return the ipv4Addresses value. + */ + public List ipv4Addresses() { + return this.ipv4Addresses; + } + + /** + * Set the ipv4Addresses property: The list of ip v4 addresses. + * + * @param ipv4Addresses the ipv4Addresses value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv4Addresses(List ipv4Addresses) { + this.ipv4Addresses = ipv4Addresses; + return this; + } + + /** + * Get the ipv6Addresses property: The list of ip v6 addresses. + * + * @return the ipv6Addresses value. + */ + public List ipv6Addresses() { + return this.ipv6Addresses; + } + + /** + * Set the ipv6Addresses property: The list of ip v6 addresses. + * + * @param ipv6Addresses the ipv6Addresses value to set. + * @return the IpAddressGroup object itself. + */ + public IpAddressGroup withIpv6Addresses(List ipv6Addresses) { + this.ipv6Addresses = ipv6Addresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipv4Addresses() != null) { + ipv4Addresses().forEach(e -> e.validate()); + } + if (ipv6Addresses() != null) { + ipv6Addresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.java new file mode 100644 index 0000000000000..80d2119edd1f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for IsDevice match conditions. */ +@Fluent +public final class IsDeviceMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleIsDeviceConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private IsDeviceOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of IsDeviceMatchConditionParameters class. */ + public IsDeviceMatchConditionParameters() { + typeName = "DeliveryRuleIsDeviceConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public IsDeviceOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withOperator(IsDeviceOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withMatchValues( + List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model IsDeviceMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IsDeviceMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParametersMatchValuesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParametersMatchValuesItem.java new file mode 100644 index 0000000000000..81e0ab73db3ed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParametersMatchValuesItem.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IsDeviceMatchConditionParametersMatchValuesItem. */ +public final class IsDeviceMatchConditionParametersMatchValuesItem + extends ExpandableStringEnum { + /** Static value Mobile for IsDeviceMatchConditionParametersMatchValuesItem. */ + public static final IsDeviceMatchConditionParametersMatchValuesItem MOBILE = fromString("Mobile"); + + /** Static value Desktop for IsDeviceMatchConditionParametersMatchValuesItem. */ + public static final IsDeviceMatchConditionParametersMatchValuesItem DESKTOP = fromString("Desktop"); + + /** + * Creates or finds a IsDeviceMatchConditionParametersMatchValuesItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsDeviceMatchConditionParametersMatchValuesItem. + */ + @JsonCreator + public static IsDeviceMatchConditionParametersMatchValuesItem fromString(String name) { + return fromString(name, IsDeviceMatchConditionParametersMatchValuesItem.class); + } + + /** + * Gets known IsDeviceMatchConditionParametersMatchValuesItem values. + * + * @return known IsDeviceMatchConditionParametersMatchValuesItem values. + */ + public static Collection values() { + return values(IsDeviceMatchConditionParametersMatchValuesItem.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.java new file mode 100644 index 0000000000000..08dbe81640f50 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class IsDeviceOperator extends ExpandableStringEnum { + /** Static value Equal for IsDeviceOperator. */ + public static final IsDeviceOperator EQUAL = fromString("Equal"); + + /** + * Creates or finds a IsDeviceOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsDeviceOperator. + */ + @JsonCreator + public static IsDeviceOperator fromString(String name) { + return fromString(name, IsDeviceOperator.class); + } + + /** + * Gets known IsDeviceOperator values. + * + * @return known IsDeviceOperator values. + */ + public static Collection values() { + return values(IsDeviceOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java new file mode 100644 index 0000000000000..c3b47047753ed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters for using a user's KeyVault certificate for securing custom domain. */ +@Fluent +public final class KeyVaultCertificateSourceParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "KeyVaultCertificateSourceParameters"; + + /* + * Subscription Id of the user's Key Vault containing the SSL certificate + */ + @JsonProperty(value = "subscriptionId", required = true) + private String subscriptionId; + + /* + * Resource group of the user's Key Vault containing the SSL certificate + */ + @JsonProperty(value = "resourceGroupName", required = true) + private String resourceGroupName; + + /* + * The name of the user's Key Vault containing the SSL certificate + */ + @JsonProperty(value = "vaultName", required = true) + private String vaultName; + + /* + * The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + */ + @JsonProperty(value = "secretName", required = true) + private String secretName; + + /* + * The version(GUID) of Key Vault Secret in Key Vault. + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /* + * Describes the action that shall be taken when the certificate is updated in Key Vault. + */ + @JsonProperty(value = "updateRule", required = true) + private UpdateRule updateRule; + + /* + * Describes the action that shall be taken when the certificate is removed from Key Vault. + */ + @JsonProperty(value = "deleteRule", required = true) + private DeleteRule deleteRule; + + /** Creates an instance of KeyVaultCertificateSourceParameters class. */ + public KeyVaultCertificateSourceParameters() { + typeName = "KeyVaultCertificateSourceParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id of the user's Key Vault containing the SSL certificate. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id of the user's Key Vault containing the SSL certificate. + * + * @param subscriptionId the subscriptionId value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroupName property: Resource group of the user's Key Vault containing the SSL certificate. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: Resource group of the user's Key Vault containing the SSL certificate. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the vaultName property: The name of the user's Key Vault containing the SSL certificate. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the vaultName property: The name of the user's Key Vault containing the SSL certificate. + * + * @param vaultName the vaultName value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Get the secretName property: The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + * + * @param secretName the secretName value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the secretVersion property: The version(GUID) of Key Vault Secret in Key Vault. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: The version(GUID) of Key Vault Secret in Key Vault. + * + * @param secretVersion the secretVersion value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Get the updateRule property: Describes the action that shall be taken when the certificate is updated in Key + * Vault. + * + * @return the updateRule value. + */ + public UpdateRule updateRule() { + return this.updateRule; + } + + /** + * Set the updateRule property: Describes the action that shall be taken when the certificate is updated in Key + * Vault. + * + * @param updateRule the updateRule value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withUpdateRule(UpdateRule updateRule) { + this.updateRule = updateRule; + return this; + } + + /** + * Get the deleteRule property: Describes the action that shall be taken when the certificate is removed from Key + * Vault. + * + * @return the deleteRule value. + */ + public DeleteRule deleteRule() { + return this.deleteRule; + } + + /** + * Set the deleteRule property: Describes the action that shall be taken when the certificate is removed from Key + * Vault. + * + * @param deleteRule the deleteRule value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withDeleteRule(DeleteRule deleteRule) { + this.deleteRule = deleteRule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subscriptionId in model KeyVaultCertificateSourceParameters")); + } + if (resourceGroupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceGroupName in model KeyVaultCertificateSourceParameters")); + } + if (vaultName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultName in model KeyVaultCertificateSourceParameters")); + } + if (secretName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretName in model KeyVaultCertificateSourceParameters")); + } + if (updateRule() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property updateRule in model KeyVaultCertificateSourceParameters")); + } + if (deleteRule() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deleteRule in model KeyVaultCertificateSourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultCertificateSourceParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.java new file mode 100644 index 0000000000000..73940d0282648 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters for using a user's KeyVault for URL Signing Key. */ +@Fluent +public final class KeyVaultSigningKeyParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "KeyVaultSigningKeyParameters"; + + /* + * Subscription Id of the user's Key Vault containing the secret + */ + @JsonProperty(value = "subscriptionId", required = true) + private String subscriptionId; + + /* + * Resource group of the user's Key Vault containing the secret + */ + @JsonProperty(value = "resourceGroupName", required = true) + private String resourceGroupName; + + /* + * The name of the user's Key Vault containing the secret + */ + @JsonProperty(value = "vaultName", required = true) + private String vaultName; + + /* + * The name of secret in Key Vault. + */ + @JsonProperty(value = "secretName", required = true) + private String secretName; + + /* + * The version(GUID) of secret in Key Vault. + */ + @JsonProperty(value = "secretVersion", required = true) + private String secretVersion; + + /** Creates an instance of KeyVaultSigningKeyParameters class. */ + public KeyVaultSigningKeyParameters() { + typeName = "KeyVaultSigningKeyParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id of the user's Key Vault containing the secret. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id of the user's Key Vault containing the secret. + * + * @param subscriptionId the subscriptionId value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroupName property: Resource group of the user's Key Vault containing the secret. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: Resource group of the user's Key Vault containing the secret. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the vaultName property: The name of the user's Key Vault containing the secret. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the vaultName property: The name of the user's Key Vault containing the secret. + * + * @param vaultName the vaultName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Get the secretName property: The name of secret in Key Vault. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The name of secret in Key Vault. + * + * @param secretName the secretName value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the secretVersion property: The version(GUID) of secret in Key Vault. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: The version(GUID) of secret in Key Vault. + * + * @param secretVersion the secretVersion value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subscriptionId in model KeyVaultSigningKeyParameters")); + } + if (resourceGroupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceGroupName in model KeyVaultSigningKeyParameters")); + } + if (vaultName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultName in model KeyVaultSigningKeyParameters")); + } + if (secretName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretName in model KeyVaultSigningKeyParameters")); + } + if (secretVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretVersion in model KeyVaultSigningKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultSigningKeyParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java new file mode 100644 index 0000000000000..8f58a3919a25f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** whether this route will be linked to the default endpoint domain. */ +public final class LinkToDefaultDomain extends ExpandableStringEnum { + /** Static value Enabled for LinkToDefaultDomain. */ + public static final LinkToDefaultDomain ENABLED = fromString("Enabled"); + + /** Static value Disabled for LinkToDefaultDomain. */ + public static final LinkToDefaultDomain DISABLED = fromString("Disabled"); + + /** + * Creates or finds a LinkToDefaultDomain from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkToDefaultDomain. + */ + @JsonCreator + public static LinkToDefaultDomain fromString(String name) { + return fromString(name, LinkToDefaultDomain.class); + } + + /** + * Gets known LinkToDefaultDomain values. + * + * @return known LinkToDefaultDomain values. + */ + public static Collection values() { + return values(LinkToDefaultDomain.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java new file mode 100644 index 0000000000000..0526ad5991945 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Round-Robin load balancing settings for a backend pool. */ +@Fluent +public final class LoadBalancingSettingsParameters { + /* + * The number of samples to consider for load balancing decisions + */ + @JsonProperty(value = "sampleSize") + private Integer sampleSize; + + /* + * The number of samples within the sample period that must succeed + */ + @JsonProperty(value = "successfulSamplesRequired") + private Integer successfulSamplesRequired; + + /* + * The additional latency in milliseconds for probes to fall into the lowest latency bucket + */ + @JsonProperty(value = "additionalLatencyInMilliseconds") + private Integer additionalLatencyInMilliseconds; + + /** Creates an instance of LoadBalancingSettingsParameters class. */ + public LoadBalancingSettingsParameters() { + } + + /** + * Get the sampleSize property: The number of samples to consider for load balancing decisions. + * + * @return the sampleSize value. + */ + public Integer sampleSize() { + return this.sampleSize; + } + + /** + * Set the sampleSize property: The number of samples to consider for load balancing decisions. + * + * @param sampleSize the sampleSize value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters withSampleSize(Integer sampleSize) { + this.sampleSize = sampleSize; + return this; + } + + /** + * Get the successfulSamplesRequired property: The number of samples within the sample period that must succeed. + * + * @return the successfulSamplesRequired value. + */ + public Integer successfulSamplesRequired() { + return this.successfulSamplesRequired; + } + + /** + * Set the successfulSamplesRequired property: The number of samples within the sample period that must succeed. + * + * @param successfulSamplesRequired the successfulSamplesRequired value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters withSuccessfulSamplesRequired(Integer successfulSamplesRequired) { + this.successfulSamplesRequired = successfulSamplesRequired; + return this; + } + + /** + * Get the additionalLatencyInMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @return the additionalLatencyInMilliseconds value. + */ + public Integer additionalLatencyInMilliseconds() { + return this.additionalLatencyInMilliseconds; + } + + /** + * Set the additionalLatencyInMilliseconds property: The additional latency in milliseconds for probes to fall into + * the lowest latency bucket. + * + * @param additionalLatencyInMilliseconds the additionalLatencyInMilliseconds value to set. + * @return the LoadBalancingSettingsParameters object itself. + */ + public LoadBalancingSettingsParameters withAdditionalLatencyInMilliseconds( + Integer additionalLatencyInMilliseconds) { + this.additionalLatencyInMilliseconds = additionalLatencyInMilliseconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.java new file mode 100644 index 0000000000000..f7d099153b782 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content load. */ +@Fluent +public final class LoadParameters { + /* + * The path to the content to be loaded. Path should be a relative file URL of the origin. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /** Creates an instance of LoadParameters class. */ + public LoadParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be loaded. Path should be a relative file URL of the + * origin. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be loaded. Path should be a relative file URL of the + * origin. + * + * @param contentPaths the contentPaths value to set. + * @return the LoadParameters object itself. + */ + public LoadParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property contentPaths in model LoadParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.java new file mode 100644 index 0000000000000..fc0b569ae9da4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.time.OffsetDateTime; +import java.util.List; + +/** Resource collection API of LogAnalytics. */ +public interface LogAnalytics { + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @param groupBy Array of LogMetricsGroupBy. + * @param continents Array of Get9ItemsItem. + * @param countryOrRegions Array of Get10ItemsItem. + * @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 log report for AFD profile along with {@link Response}. + */ + Response getLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions, + Context context); + + /** + * Get log report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of LogMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param customDomains Array of Get11ItemsItem. + * @param protocols Array of Get12ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log report for AFD profile. + */ + MetricsResponse getLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param customDomains Array of String. + * @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 log analytics ranking report for AFD profile along with {@link Response}. + */ + Response getLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + Context context); + + /** + * Get log analytics ranking report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param rankings Array of LogRanking. + * @param metrics Array of LogRankingMetric. + * @param maxRanking The maxRanking parameter. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log analytics ranking report for AFD profile. + */ + RankingsResponse getLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report along with {@link Response}. + */ + Response getLogAnalyticsLocationsWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Get all available location names for AFD log analytics report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available location names for AFD log analytics report. + */ + ContinentsResponse getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report along with {@link Response}. + */ + Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Get all endpoints and custom domains available for AFD log report. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all endpoints and custom domains available for AFD log report. + */ + ResourcesResponse getLogAnalyticsResources(String resourceGroupName, String profileName); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @param actions Array of WafAction. + * @param groupBy Array of WafRankingGroupBy. + * @param ruleTypes Array of WafRuleType. + * @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 waf related log analytics report for AFD profile along with {@link Response}. + */ + Response getWafLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes, + Context context); + + /** + * Get Waf related log analytics report for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param granularity The granularity parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return waf related log analytics report for AFD profile. + */ + WafMetricsResponse getWafLogAnalyticsMetrics( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @param actions Array of WafAction. + * @param ruleTypes Array of WafRuleType. + * @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 wAF log analytics charts for AFD profile along with {@link Response}. + */ + Response getWafLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context); + + /** + * Get WAF log analytics charts for AFD profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. which is unique within the resource group. + * @param metrics Array of WafMetric. + * @param dateTimeBegin The dateTimeBegin parameter. + * @param dateTimeEnd The dateTimeEnd parameter. + * @param maxRanking The maxRanking parameter. + * @param rankings Array of WafRankingType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wAF log analytics charts for AFD profile. + */ + WafRankingsResponse getWafLogAnalyticsRankings( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java new file mode 100644 index 0000000000000..379cc3362f476 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogMetric. */ +public final class LogMetric extends ExpandableStringEnum { + /** Static value clientRequestCount for LogMetric. */ + public static final LogMetric CLIENT_REQUEST_COUNT = fromString("clientRequestCount"); + + /** Static value clientRequestTraffic for LogMetric. */ + public static final LogMetric CLIENT_REQUEST_TRAFFIC = fromString("clientRequestTraffic"); + + /** Static value clientRequestBandwidth for LogMetric. */ + public static final LogMetric CLIENT_REQUEST_BANDWIDTH = fromString("clientRequestBandwidth"); + + /** Static value originRequestTraffic for LogMetric. */ + public static final LogMetric ORIGIN_REQUEST_TRAFFIC = fromString("originRequestTraffic"); + + /** Static value originRequestBandwidth for LogMetric. */ + public static final LogMetric ORIGIN_REQUEST_BANDWIDTH = fromString("originRequestBandwidth"); + + /** Static value totalLatency for LogMetric. */ + public static final LogMetric TOTAL_LATENCY = fromString("totalLatency"); + + /** + * Creates or finds a LogMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetric. + */ + @JsonCreator + public static LogMetric fromString(String name) { + return fromString(name, LogMetric.class); + } + + /** + * Gets known LogMetric values. + * + * @return known LogMetric values. + */ + public static Collection values() { + return values(LogMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java new file mode 100644 index 0000000000000..509881f8cfc0e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogMetricsGranularity. */ +public final class LogMetricsGranularity extends ExpandableStringEnum { + /** Static value PT5M for LogMetricsGranularity. */ + public static final LogMetricsGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for LogMetricsGranularity. */ + public static final LogMetricsGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for LogMetricsGranularity. */ + public static final LogMetricsGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a LogMetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetricsGranularity. + */ + @JsonCreator + public static LogMetricsGranularity fromString(String name) { + return fromString(name, LogMetricsGranularity.class); + } + + /** + * Gets known LogMetricsGranularity values. + * + * @return known LogMetricsGranularity values. + */ + public static Collection values() { + return values(LogMetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java new file mode 100644 index 0000000000000..3ec29c70d1f22 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogMetricsGroupBy. */ +public final class LogMetricsGroupBy extends ExpandableStringEnum { + /** Static value httpStatusCode for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy HTTP_STATUS_CODE = fromString("httpStatusCode"); + + /** Static value protocol for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy PROTOCOL = fromString("protocol"); + + /** Static value cacheStatus for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy CACHE_STATUS = fromString("cacheStatus"); + + /** Static value countryOrRegion for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** Static value customDomain for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy CUSTOM_DOMAIN = fromString("customDomain"); + + /** + * Creates or finds a LogMetricsGroupBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogMetricsGroupBy. + */ + @JsonCreator + public static LogMetricsGroupBy fromString(String name) { + return fromString(name, LogMetricsGroupBy.class); + } + + /** + * Gets known LogMetricsGroupBy values. + * + * @return known LogMetricsGroupBy values. + */ + public static Collection values() { + return values(LogMetricsGroupBy.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java new file mode 100644 index 0000000000000..774f9ddf7456a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogRanking. */ +public final class LogRanking extends ExpandableStringEnum { + /** Static value url for LogRanking. */ + public static final LogRanking URL = fromString("url"); + + /** Static value referrer for LogRanking. */ + public static final LogRanking REFERRER = fromString("referrer"); + + /** Static value browser for LogRanking. */ + public static final LogRanking BROWSER = fromString("browser"); + + /** Static value userAgent for LogRanking. */ + public static final LogRanking USER_AGENT = fromString("userAgent"); + + /** Static value countryOrRegion for LogRanking. */ + public static final LogRanking COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** + * Creates or finds a LogRanking from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogRanking. + */ + @JsonCreator + public static LogRanking fromString(String name) { + return fromString(name, LogRanking.class); + } + + /** + * Gets known LogRanking values. + * + * @return known LogRanking values. + */ + public static Collection values() { + return values(LogRanking.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java new file mode 100644 index 0000000000000..9915b50c98694 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogRankingMetric. */ +public final class LogRankingMetric extends ExpandableStringEnum { + /** Static value clientRequestCount for LogRankingMetric. */ + public static final LogRankingMetric CLIENT_REQUEST_COUNT = fromString("clientRequestCount"); + + /** Static value clientRequestTraffic for LogRankingMetric. */ + public static final LogRankingMetric CLIENT_REQUEST_TRAFFIC = fromString("clientRequestTraffic"); + + /** Static value hitCount for LogRankingMetric. */ + public static final LogRankingMetric HIT_COUNT = fromString("hitCount"); + + /** Static value missCount for LogRankingMetric. */ + public static final LogRankingMetric MISS_COUNT = fromString("missCount"); + + /** Static value userErrorCount for LogRankingMetric. */ + public static final LogRankingMetric USER_ERROR_COUNT = fromString("userErrorCount"); + + /** Static value errorCount for LogRankingMetric. */ + public static final LogRankingMetric ERROR_COUNT = fromString("errorCount"); + + /** + * Creates or finds a LogRankingMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogRankingMetric. + */ + @JsonCreator + public static LogRankingMetric fromString(String name) { + return fromString(name, LogRankingMetric.class); + } + + /** + * Gets known LogRankingMetric values. + * + * @return known LogRankingMetric values. + */ + public static Collection values() { + return values(LogRankingMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java new file mode 100644 index 0000000000000..c297480a06343 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogSpecification.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log specification of operation. */ +@Fluent +public final class LogSpecification { + /* + * Name of log specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of log specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of specification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /* + * Pattern to filter based on name + */ + @JsonProperty(value = "logFilterPattern") + private String logFilterPattern; + + /** Creates an instance of LogSpecification class. */ + public LogSpecification() { + } + + /** + * Get the name property: Name of log specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of log specification. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of log specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of log specification. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of specification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of specification. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Get the logFilterPattern property: Pattern to filter based on name. + * + * @return the logFilterPattern value. + */ + public String logFilterPattern() { + return this.logFilterPattern; + } + + /** + * Set the logFilterPattern property: Pattern to filter based on name. + * + * @param logFilterPattern the logFilterPattern value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withLogFilterPattern(String logFilterPattern) { + this.logFilterPattern = logFilterPattern; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.java new file mode 100644 index 0000000000000..e94164d2cb054 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; + +/** Managed Certificate used for https. */ +@Fluent +public final class ManagedCertificate extends Certificate { + /** Creates an instance of ManagedCertificate class. */ + public ManagedCertificate() { + } + + /** {@inheritDoc} */ + @Override + public ManagedCertificate withType(SecretType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.java new file mode 100644 index 0000000000000..26dd9db988b43 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Managed Certificate used for https. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ManagedCertificate") +@Immutable +public final class ManagedCertificateParameters extends SecretParameters { + /* + * Subject name in the certificate. + */ + @JsonProperty(value = "subject", access = JsonProperty.Access.WRITE_ONLY) + private String subject; + + /* + * Certificate expiration date. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /** Creates an instance of ManagedCertificateParameters class. */ + public ManagedCertificateParameters() { + } + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleDefinition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleDefinition.java new file mode 100644 index 0000000000000..6934a616e50db --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleDefinition.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a managed rule definition. */ +@Immutable +public final class ManagedRuleDefinition { + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", access = JsonProperty.Access.WRITE_ONLY) + private String ruleId; + + /* + * Describes the functionality of the managed rule. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of ManagedRuleDefinition class. */ + public ManagedRuleDefinition() { + } + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Get the description property: Describes the functionality of the managed rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.java new file mode 100644 index 0000000000000..75f5d6b32ce5c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + @JsonCreator + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** + * Gets known ManagedRuleEnabledState values. + * + * @return known ManagedRuleEnabledState values. + */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java new file mode 100644 index 0000000000000..3106793f1d436 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a managed rule group. */ +@Immutable +public final class ManagedRuleGroupDefinition { + /* + * Name of the managed rule group. + */ + @JsonProperty(value = "ruleGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String ruleGroupName; + + /* + * Description of the managed rule group. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * List of rules within the managed rule group. + */ + @JsonProperty(value = "rules", access = JsonProperty.Access.WRITE_ONLY) + private List rules; + + /** Creates an instance of ManagedRuleGroupDefinition class. */ + public ManagedRuleGroupDefinition() { + } + + /** + * Get the ruleGroupName property: Name of the managed rule group. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Get the description property: Description of the managed rule group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the rules property: List of rules within the managed rule group. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.java new file mode 100644 index 0000000000000..5b911714b7c68 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + /* + * Describes the managed rule group within the rule set to override + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * List of rules that will be enabled. If none specified, all rules in the group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of ManagedRuleGroupOverride class. */ + public ManagedRuleGroupOverride() { + } + + /** + * Get the ruleGroupName property: Describes the managed rule group within the rule set to override. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: Describes the managed rule group within the rule set to override. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: List of rules that will be enabled. If none specified, all rules in the group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be enabled. If none specified, all rules in the group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleGroupOverride.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.java new file mode 100644 index 0000000000000..3cf3112ebd46e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. + */ + @JsonProperty(value = "enabledState") + private ManagedRuleEnabledState enabledState; + + /* + * Describes the override action to be applied when rule matches. + */ + @JsonProperty(value = "action") + private ActionType action; + + /** Creates an instance of ManagedRuleOverride class. */ + public ManagedRuleOverride() { + } + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Identifier for the managed rule. + * + * @param ruleId the ruleId value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the enabledState property: Describes if the managed rule is in enabled or disabled state. Defaults to + * Disabled if not specified. + * + * @return the enabledState value. + */ + public ManagedRuleEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Describes if the managed rule is in enabled or disabled state. Defaults to + * Disabled if not specified. + * + * @param enabledState the enabledState value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withEnabledState(ManagedRuleEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the action property: Describes the override action to be applied when rule matches. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Describes the override action to be applied when rule matches. + * + * @param action the action value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleOverride.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.java new file mode 100644 index 0000000000000..f2d3cfdc968fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Verizon only : If the rule set supports anomaly detection mode, this describes the threshold for blocking + * requests. + */ + @JsonProperty(value = "anomalyScore") + private Integer anomalyScore; + + /* + * Defines the rule overrides to apply to the rule set. + */ + @JsonProperty(value = "ruleGroupOverrides") + private List ruleGroupOverrides; + + /** Creates an instance of ManagedRuleSet class. */ + public ManagedRuleSet() { + } + + /** + * Get the ruleSetType property: Defines the rule set type to use. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: Defines the rule set type to use. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: Defines the version of the rule set to use. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: Defines the version of the rule set to use. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the anomalyScore property: Verizon only : If the rule set supports anomaly detection mode, this describes the + * threshold for blocking requests. + * + * @return the anomalyScore value. + */ + public Integer anomalyScore() { + return this.anomalyScore; + } + + /** + * Set the anomalyScore property: Verizon only : If the rule set supports anomaly detection mode, this describes the + * threshold for blocking requests. + * + * @param anomalyScore the anomalyScore value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withAnomalyScore(Integer anomalyScore) { + this.anomalyScore = anomalyScore; + return this; + } + + /** + * Get the ruleGroupOverrides property: Defines the rule overrides to apply to the rule set. + * + * @return the ruleGroupOverrides value. + */ + public List ruleGroupOverrides() { + return this.ruleGroupOverrides; + } + + /** + * Set the ruleGroupOverrides property: Defines the rule overrides to apply to the rule set. + * + * @param ruleGroupOverrides the ruleGroupOverrides value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleGroupOverrides(List ruleGroupOverrides) { + this.ruleGroupOverrides = ruleGroupOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSet.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.java new file mode 100644 index 0000000000000..199a5f563be85 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import java.util.List; + +/** An immutable client-side representation of ManagedRuleSetDefinition. */ +public interface ManagedRuleSetDefinition { + /** + * 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 sku property: The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the managed rule set. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the ruleSetType property: Type of the managed rule set. + * + * @return the ruleSetType value. + */ + String ruleSetType(); + + /** + * Gets the ruleSetVersion property: Version of the managed rule set type. + * + * @return the ruleSetVersion value. + */ + String ruleSetVersion(); + + /** + * Gets the ruleGroups property: Rule groups of the managed rule set. + * + * @return the ruleGroups value. + */ + List ruleGroups(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner object. + * + * @return the inner object. + */ + ManagedRuleSetDefinitionInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java new file mode 100644 index 0000000000000..1ea940d11c0b8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed rule set definitions available for use in a policy. */ +@Fluent +public final class ManagedRuleSetDefinitionList { + /* + * List of managed rule set definitions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to retrieve next set of managed rule set definitions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ManagedRuleSetDefinitionList class. */ + public ManagedRuleSetDefinitionList() { + } + + /** + * Get the value property: List of managed rule set definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to retrieve next set of managed rule set definitions. + * + * @param nextLink the nextLink value to set. + * @return the ManagedRuleSetDefinitionList object itself. + */ + public ManagedRuleSetDefinitionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetList.java new file mode 100644 index 0000000000000..6ba3cc93663d3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetList.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the list of managed rule sets for the policy. */ +@Fluent +public final class ManagedRuleSetList { + /* + * List of rule sets. + */ + @JsonProperty(value = "managedRuleSets") + private List managedRuleSets; + + /** Creates an instance of ManagedRuleSetList class. */ + public ManagedRuleSetList() { + } + + /** + * Get the managedRuleSets property: List of rule sets. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: List of rule sets. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRuleSetList object itself. + */ + public ManagedRuleSetList withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedRuleSets() != null) { + managedRuleSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.java new file mode 100644 index 0000000000000..9d9721b0058e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedRuleSets. */ +public interface ManagedRuleSets { + /** + * Lists all available managed rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all available managed rule 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 list of managed rule set definitions available for use in a policy as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..dd5e973682dca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..38789e32ab966 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedServiceIdentityType.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java new file mode 100644 index 0000000000000..d110c88996caa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define match conditions. */ +@Fluent +public final class MatchCondition { + /* + * Match variable to compare against. + */ + @JsonProperty(value = "matchVariable", required = true) + private WafMatchVariable matchVariable; + + /* + * Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs. + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private Operator operator; + + /* + * Describes if the result of this condition should be negated. + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * List of possible match values. + */ + @JsonProperty(value = "matchValue", required = true) + private List matchValue; + + /* + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of MatchCondition class. */ + public MatchCondition() { + } + + /** + * Get the matchVariable property: Match variable to compare against. + * + * @return the matchVariable value. + */ + public WafMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: Match variable to compare against. + * + * @param matchVariable the matchVariable value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariable(WafMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selector property: Selector can used to match a specific key for QueryString, Cookies, RequestHeader or + * PostArgs. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Selector can used to match a specific key for QueryString, Cookies, RequestHeader or + * PostArgs. + * + * @param selector the selector value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public Operator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(Operator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if the result of this condition should be negated. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if the result of this condition should be negated. + * + * @param negateCondition the negateCondition value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValue property: List of possible match values. + * + * @return the matchValue value. + */ + public List matchValue() { + return this.matchValue; + } + + /** + * Set the matchValue property: List of possible match values. + * + * @param matchValue the matchValue value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValue(List matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchVariable in model MatchCondition")); + } + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValue() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchValue in model MatchCondition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchCondition.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.java new file mode 100644 index 0000000000000..ecbe5f247610e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, + * defaults to Continue. + */ +public final class MatchProcessingBehavior extends ExpandableStringEnum { + /** Static value Continue for MatchProcessingBehavior. */ + public static final MatchProcessingBehavior CONTINUE = fromString("Continue"); + + /** Static value Stop for MatchProcessingBehavior. */ + public static final MatchProcessingBehavior STOP = fromString("Stop"); + + /** + * Creates or finds a MatchProcessingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchProcessingBehavior. + */ + @JsonCreator + public static MatchProcessingBehavior fromString(String name) { + return fromString(name, MatchProcessingBehavior.class); + } + + /** + * Gets known MatchProcessingBehavior values. + * + * @return known MatchProcessingBehavior values. + */ + public static Collection values() { + return values(MatchProcessingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java new file mode 100644 index 0000000000000..220dac3297914 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The name of the condition for the delivery rule. */ +public final class MatchVariable extends ExpandableStringEnum { + /** Static value RemoteAddress for MatchVariable. */ + public static final MatchVariable REMOTE_ADDRESS = fromString("RemoteAddress"); + + /** Static value RequestMethod for MatchVariable. */ + public static final MatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value QueryString for MatchVariable. */ + public static final MatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value PostArgs for MatchVariable. */ + public static final MatchVariable POST_ARGS = fromString("PostArgs"); + + /** Static value RequestUri for MatchVariable. */ + public static final MatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value RequestHeader for MatchVariable. */ + public static final MatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** Static value RequestBody for MatchVariable. */ + public static final MatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value RequestScheme for MatchVariable. */ + public static final MatchVariable REQUEST_SCHEME = fromString("RequestScheme"); + + /** Static value UrlPath for MatchVariable. */ + public static final MatchVariable URL_PATH = fromString("UrlPath"); + + /** Static value UrlFileExtension for MatchVariable. */ + public static final MatchVariable URL_FILE_EXTENSION = fromString("UrlFileExtension"); + + /** Static value UrlFileName for MatchVariable. */ + public static final MatchVariable URL_FILE_NAME = fromString("UrlFileName"); + + /** Static value HttpVersion for MatchVariable. */ + public static final MatchVariable HTTP_VERSION = fromString("HttpVersion"); + + /** Static value Cookies for MatchVariable. */ + public static final MatchVariable COOKIES = fromString("Cookies"); + + /** Static value IsDevice for MatchVariable. */ + public static final MatchVariable IS_DEVICE = fromString("IsDevice"); + + /** Static value SocketAddr for MatchVariable. */ + public static final MatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** Static value ClientPort for MatchVariable. */ + public static final MatchVariable CLIENT_PORT = fromString("ClientPort"); + + /** Static value ServerPort for MatchVariable. */ + public static final MatchVariable SERVER_PORT = fromString("ServerPort"); + + /** Static value HostName for MatchVariable. */ + public static final MatchVariable HOST_NAME = fromString("HostName"); + + /** Static value SslProtocol for MatchVariable. */ + public static final MatchVariable SSL_PROTOCOL = fromString("SslProtocol"); + + /** + * Creates or finds a MatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchVariable. + */ + @JsonCreator + public static MatchVariable fromString(String name) { + return fromString(name, MatchVariable.class); + } + + /** + * Gets known MatchVariable values. + * + * @return known MatchVariable values. + */ + public static Collection values() { + return values(MatchVariable.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java new file mode 100644 index 0000000000000..95c34a6b4f136 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricAvailability.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Retention policy of a resource metric. */ +@Fluent +public final class MetricAvailability { + /* + * The timeGrain property. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The blobDuration property. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** Creates an instance of MetricAvailability class. */ + public MetricAvailability() { + } + + /** + * Get the timeGrain property: The timeGrain property. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The timeGrain property. + * + * @param timeGrain the timeGrain value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the blobDuration property: The blobDuration property. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration property. + * + * @param blobDuration the blobDuration value to set. + * @return the MetricAvailability object itself. + */ + public MetricAvailability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..bb972b089e26d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricSpecification.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + /* + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Retention policies of a resource metric. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /* + * The supported time grain types for the metrics. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * The dimensions of metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Property to specify whether to fill gap with zero. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Pattern to filter based on name + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /* + * Property to specify metric is internal or not. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /** Creates an instance of MetricSpecification class. */ + public MetricSpecification() { + } + + /** + * Get the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of metric specification. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of metric specification. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description of metric specification. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the availabilities property: Retention policies of a resource metric. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: Retention policies of a resource metric. + * + * @param availabilities the availabilities value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the dimensions property: The dimensions of metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions of metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the metricFilterPattern property: Pattern to filter based on name. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: Pattern to filter based on name. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get the isInternal property: Property to specify metric is internal or not. + * + * @return the isInternal value. + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set the isInternal property: Property to specify metric is internal or not. + * + * @param isInternal the isInternal value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.java new file mode 100644 index 0000000000000..339cda5542c8d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsGranularity.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricsGranularity. */ +public final class MetricsGranularity extends ExpandableStringEnum { + /** Static value PT5M for MetricsGranularity. */ + public static final MetricsGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for MetricsGranularity. */ + public static final MetricsGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for MetricsGranularity. */ + public static final MetricsGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a MetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsGranularity. + */ + @JsonCreator + public static MetricsGranularity fromString(String name) { + return fromString(name, MetricsGranularity.class); + } + + /** + * Gets known MetricsGranularity values. + * + * @return known MetricsGranularity values. + */ + public static Collection values() { + return values(MetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java new file mode 100644 index 0000000000000..5267e3086db72 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of MetricsResponse. */ +public interface MetricsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the granularity property: The granularity property. + * + * @return the granularity value. + */ + MetricsGranularity granularity(); + + /** + * Gets the series property: The series property. + * + * @return the series value. + */ + List series(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner object. + * + * @return the inner object. + */ + MetricsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java new file mode 100644 index 0000000000000..9b4154cf2f987 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MetricsResponseSeriesItem model. */ +@Fluent +public final class MetricsResponseSeriesItem { + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private MetricsSeriesUnit unit; + + /* + * The groups property. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** Creates an instance of MetricsResponseSeriesItem class. */ + public MetricsResponseSeriesItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public MetricsSeriesUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withUnit(MetricsSeriesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the MetricsResponseSeriesItem object itself. + */ + public MetricsResponseSeriesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (data() != null) { + data().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java new file mode 100644 index 0000000000000..3ce31234d6029 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemData.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The MetricsResponseSeriesItemData model. */ +@Fluent +public final class MetricsResponseSeriesItemData { + /* + * The dateTime property. + */ + @JsonProperty(value = "dateTime") + private OffsetDateTime dateTime; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Float value; + + /** Creates an instance of MetricsResponseSeriesItemData class. */ + public MetricsResponseSeriesItemData() { + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + public OffsetDateTime dateTime() { + return this.dateTime; + } + + /** + * Set the dateTime property: The dateTime property. + * + * @param dateTime the dateTime value to set. + * @return the MetricsResponseSeriesItemData object itself. + */ + public MetricsResponseSeriesItemData withDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MetricsResponseSeriesItemData object itself. + */ + public MetricsResponseSeriesItemData withValue(Float 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesPropertiesItemsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesPropertiesItemsItem.java new file mode 100644 index 0000000000000..3f5a99291cf84 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesPropertiesItemsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MetricsResponseSeriesPropertiesItemsItem model. */ +@Fluent +public final class MetricsResponseSeriesPropertiesItemsItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of MetricsResponseSeriesPropertiesItemsItem class. */ + public MetricsResponseSeriesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the MetricsResponseSeriesPropertiesItemsItem object itself. + */ + public MetricsResponseSeriesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MetricsResponseSeriesPropertiesItemsItem object itself. + */ + public MetricsResponseSeriesPropertiesItemsItem 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.java new file mode 100644 index 0000000000000..8f471b458b297 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsSeriesUnit.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricsSeriesUnit. */ +public final class MetricsSeriesUnit extends ExpandableStringEnum { + /** Static value count for MetricsSeriesUnit. */ + public static final MetricsSeriesUnit COUNT = fromString("count"); + + /** Static value bytes for MetricsSeriesUnit. */ + public static final MetricsSeriesUnit BYTES = fromString("bytes"); + + /** Static value bitsPerSecond for MetricsSeriesUnit. */ + public static final MetricsSeriesUnit BITS_PER_SECOND = fromString("bitsPerSecond"); + + /** Static value milliSeconds for MetricsSeriesUnit. */ + public static final MetricsSeriesUnit MILLI_SECONDS = fromString("milliSeconds"); + + /** + * Creates or finds a MetricsSeriesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsSeriesUnit. + */ + @JsonCreator + public static MetricsSeriesUnit fromString(String name) { + return fromString(name, MetricsSeriesUnit.class); + } + + /** + * Gets known MetricsSeriesUnit values. + * + * @return known MetricsSeriesUnit values. + */ + public static Collection values() { + return values(MetricsSeriesUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java new file mode 100644 index 0000000000000..13176e81687d6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrateResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner; +import java.util.List; + +/** An immutable client-side representation of MigrateResult. */ +public interface MigrateResult { + /** + * Gets the migratedProfileResourceId property: Arm resource id of the migrated profile. + * + * @return the migratedProfileResourceId value. + */ + ResourceReference migratedProfileResourceId(); + + /** + * Gets the errors property: The errors property. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.MigrateResultInner object. + * + * @return the inner object. + */ + MigrateResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java new file mode 100644 index 0000000000000..6f24b4a9ed833 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationErrorType.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error + * message. + */ +@Immutable +public final class MigrationErrorType { + /* + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Resource which has the problem. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * Describes what needs to be done to fix the problem + */ + @JsonProperty(value = "nextSteps", access = JsonProperty.Access.WRITE_ONLY) + private String nextSteps; + + /** Creates an instance of MigrationErrorType class. */ + public MigrationErrorType() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the resourceName property: Resource which has the problem. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the errorMessage property: Error message indicating why the operation failed. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the nextSteps property: Describes what needs to be done to fix the problem. + * + * @return the nextSteps value. + */ + public String nextSteps() { + return this.nextSteps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java new file mode 100644 index 0000000000000..991eef052788a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationParameters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Request body for Migrate operation. */ +@Fluent +public final class MigrationParameters { + /* + * Sku for the migration + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + */ + @JsonProperty(value = "classicResourceReference", required = true) + private ResourceReference classicResourceReference; + + /* + * Name of the new profile that need to be created. + */ + @JsonProperty(value = "profileName", required = true) + private String profileName; + + /* + * Waf mapping for the migrated profile + */ + @JsonProperty(value = "migrationWebApplicationFirewallMappings") + private List migrationWebApplicationFirewallMappings; + + /** Creates an instance of MigrationParameters class. */ + public MigrationParameters() { + } + + /** + * Get the sku property: Sku for the migration. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku for the migration. + * + * @param sku the sku value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @return the classicResourceReference value. + */ + public ResourceReference classicResourceReference() { + return this.classicResourceReference; + } + + /** + * Set the classicResourceReference property: Resource reference of the classic cdn profile or classic frontdoor + * that need to be migrated. + * + * @param classicResourceReference the classicResourceReference value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withClassicResourceReference(ResourceReference classicResourceReference) { + this.classicResourceReference = classicResourceReference; + return this; + } + + /** + * Get the profileName property: Name of the new profile that need to be created. + * + * @return the profileName value. + */ + public String profileName() { + return this.profileName; + } + + /** + * Set the profileName property: Name of the new profile that need to be created. + * + * @param profileName the profileName value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withProfileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get the migrationWebApplicationFirewallMappings property: Waf mapping for the migrated profile. + * + * @return the migrationWebApplicationFirewallMappings value. + */ + public List migrationWebApplicationFirewallMappings() { + return this.migrationWebApplicationFirewallMappings; + } + + /** + * Set the migrationWebApplicationFirewallMappings property: Waf mapping for the migrated profile. + * + * @param migrationWebApplicationFirewallMappings the migrationWebApplicationFirewallMappings value to set. + * @return the MigrationParameters object itself. + */ + public MigrationParameters withMigrationWebApplicationFirewallMappings( + List migrationWebApplicationFirewallMappings) { + this.migrationWebApplicationFirewallMappings = migrationWebApplicationFirewallMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model MigrationParameters")); + } else { + sku().validate(); + } + if (classicResourceReference() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property classicResourceReference in model MigrationParameters")); + } else { + classicResourceReference().validate(); + } + if (profileName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property profileName in model MigrationParameters")); + } + if (migrationWebApplicationFirewallMappings() != null) { + migrationWebApplicationFirewallMappings().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrationParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java new file mode 100644 index 0000000000000..d5c7e4da5ecfd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MigrationWebApplicationFirewallMapping.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Web Application Firewall Mapping. */ +@Fluent +public final class MigrationWebApplicationFirewallMapping { + /* + * Migration From Waf policy + */ + @JsonProperty(value = "migratedFrom") + private ResourceReference migratedFrom; + + /* + * Migration to Waf policy + */ + @JsonProperty(value = "migratedTo") + private ResourceReference migratedTo; + + /** Creates an instance of MigrationWebApplicationFirewallMapping class. */ + public MigrationWebApplicationFirewallMapping() { + } + + /** + * Get the migratedFrom property: Migration From Waf policy. + * + * @return the migratedFrom value. + */ + public ResourceReference migratedFrom() { + return this.migratedFrom; + } + + /** + * Set the migratedFrom property: Migration From Waf policy. + * + * @param migratedFrom the migratedFrom value to set. + * @return the MigrationWebApplicationFirewallMapping object itself. + */ + public MigrationWebApplicationFirewallMapping withMigratedFrom(ResourceReference migratedFrom) { + this.migratedFrom = migratedFrom; + return this; + } + + /** + * Get the migratedTo property: Migration to Waf policy. + * + * @return the migratedTo value. + */ + public ResourceReference migratedTo() { + return this.migratedTo; + } + + /** + * Set the migratedTo property: Migration to Waf policy. + * + * @param migratedTo the migratedTo value to set. + * @return the MigrationWebApplicationFirewallMapping object itself. + */ + public MigrationWebApplicationFirewallMapping withMigratedTo(ResourceReference migratedTo) { + this.migratedTo = migratedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migratedFrom() != null) { + migratedFrom().validate(); + } + if (migratedTo() != null) { + migratedTo().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.java new file mode 100644 index 0000000000000..8d7159f7fbd19 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** TLS protocol version that will be used for Https. */ +public enum MinimumTlsVersion { + /** Enum value None. */ + NONE("None"), + + /** Enum value TLS10. */ + TLS10("TLS10"), + + /** Enum value TLS12. */ + TLS12("TLS12"); + + /** The actual serialized value for a MinimumTlsVersion instance. */ + private final String value; + + MinimumTlsVersion(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MinimumTlsVersion instance. + * + * @param value the serialized value to parse. + * @return the parsed MinimumTlsVersion object, or null if unable to parse. + */ + @JsonCreator + public static MinimumTlsVersion fromString(String value) { + if (value == null) { + return null; + } + MinimumTlsVersion[] items = MinimumTlsVersion.values(); + for (MinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.java new file mode 100644 index 0000000000000..8da1f55b38022 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..a43c15f965d50 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Immutable +public final class OperationDisplay { + /* + * Service provider: Microsoft.Cdn + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Description of operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: Service provider: Microsoft.Cdn. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Description of operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operations.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operations.java new file mode 100644 index 0000000000000..05dabf825789d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available CDN REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available CDN REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list CDN operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.java new file mode 100644 index 0000000000000..5bd96714b8794 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of + * results. + */ +@Fluent +public final class OperationsListResult { + /* + * List of CDN operations supported by the CDN resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OperationsListResult class. */ + public OperationsListResult() { + } + + /** + * Get the value property: List of CDN operations supported by the CDN resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of CDN operations supported by the CDN resource provider. + * + * @param value the value value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationsListResult object itself. + */ + public OperationsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.java new file mode 100644 index 0000000000000..dba54d53a06f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class Operator extends ExpandableStringEnum { + /** Static value Any for Operator. */ + public static final Operator ANY = fromString("Any"); + + /** Static value IPMatch for Operator. */ + public static final Operator IPMATCH = fromString("IPMatch"); + + /** Static value GeoMatch for Operator. */ + public static final Operator GEO_MATCH = fromString("GeoMatch"); + + /** Static value Equal for Operator. */ + public static final Operator EQUAL = fromString("Equal"); + + /** Static value Contains for Operator. */ + public static final Operator CONTAINS = fromString("Contains"); + + /** Static value LessThan for Operator. */ + public static final Operator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for Operator. */ + public static final Operator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for Operator. */ + public static final Operator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for Operator. */ + public static final Operator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for Operator. */ + public static final Operator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for Operator. */ + public static final Operator ENDS_WITH = fromString("EndsWith"); + + /** Static value RegEx for Operator. */ + public static final Operator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a Operator from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operator. + */ + @JsonCreator + public static Operator fromString(String name) { + return fromString(name, Operator.class); + } + + /** + * Gets known Operator values. + * + * @return known Operator values. + */ + public static Collection values() { + return values(Operator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java new file mode 100644 index 0000000000000..9da88daeb9488 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies what scenario the customer wants this CDN endpoint to optimize, e.g. Download, Media services. With this + * information we can apply scenario driven optimization. + */ +public final class OptimizationType extends ExpandableStringEnum { + /** Static value GeneralWebDelivery for OptimizationType. */ + public static final OptimizationType GENERAL_WEB_DELIVERY = fromString("GeneralWebDelivery"); + + /** Static value GeneralMediaStreaming for OptimizationType. */ + public static final OptimizationType GENERAL_MEDIA_STREAMING = fromString("GeneralMediaStreaming"); + + /** Static value VideoOnDemandMediaStreaming for OptimizationType. */ + public static final OptimizationType VIDEO_ON_DEMAND_MEDIA_STREAMING = fromString("VideoOnDemandMediaStreaming"); + + /** Static value LargeFileDownload for OptimizationType. */ + public static final OptimizationType LARGE_FILE_DOWNLOAD = fromString("LargeFileDownload"); + + /** Static value DynamicSiteAcceleration for OptimizationType. */ + public static final OptimizationType DYNAMIC_SITE_ACCELERATION = fromString("DynamicSiteAcceleration"); + + /** + * Creates or finds a OptimizationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OptimizationType. + */ + @JsonCreator + public static OptimizationType fromString(String name) { + return fromString(name, OptimizationType.class); + } + + /** + * Gets known OptimizationType values. + * + * @return known OptimizationType values. + */ + public static Collection values() { + return values(OptimizationType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java new file mode 100644 index 0000000000000..7598c5cfe4a24 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; + +/** An immutable client-side representation of Origin. */ +public interface Origin { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the origin. + * + * @return the resourceState value. + */ + OriginResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the origin. + * + * @return the provisioningState value. + */ + OriginProvisioningState provisioningState(); + + /** + * Gets the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + PrivateEndpointStatus privateEndpointStatus(); + + /** + * Gets the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + Integer httpPort(); + + /** + * Gets the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + Integer httpsPort(); + + /** + * Gets the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + String originHostHeader(); + + /** + * Gets the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + Integer weight(); + + /** + * Gets the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + String privateLinkAlias(); + + /** + * Gets the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + String privateLinkResourceId(); + + /** + * Gets the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + String privateLinkLocation(); + + /** + * Gets the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + String privateLinkApprovalMessage(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner object. + * + * @return the inner object. + */ + OriginInner innerModel(); + + /** The entirety of the Origin definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Origin definition stages. */ + interface DefinitionStages { + /** The first stage of the Origin definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Origin definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + /** + * The stage of the Origin 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.WithHostname, + DefinitionStages.WithHttpPort, + DefinitionStages.WithHttpsPort, + DefinitionStages.WithOriginHostHeader, + DefinitionStages.WithPriority, + DefinitionStages.WithWeight, + DefinitionStages.WithEnabled, + DefinitionStages.WithPrivateLinkAlias, + DefinitionStages.WithPrivateLinkResourceId, + DefinitionStages.WithPrivateLinkLocation, + DefinitionStages.WithPrivateLinkApprovalMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + Origin create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Origin create(Context context); + } + /** The stage of the Origin definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + /** The stage of the Origin definition allowing to specify httpPort. */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpPort(Integer httpPort); + } + /** The stage of the Origin definition allowing to specify httpsPort. */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + WithCreate withHttpsPort(Integer httpsPort); + } + /** The stage of the Origin definition allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, + * and Cloud Services require this host header value to match the origin hostname by default. This + * overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + WithCreate withOriginHostHeader(String originHostHeader); + } + /** The stage of the Origin definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the Origin definition allowing to specify weight. */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + WithCreate withWeight(Integer weight); + } + /** The stage of the Origin definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled Origin is enabled for load balancing or not. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + /** The stage of the Origin definition allowing to specify privateLinkAlias. */ + interface WithPrivateLinkAlias { + /** + * Specifies the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional + * field indicates that this origin is 'Private'. + * + * @param privateLinkAlias The Alias of the Private Link resource. Populating this optional field indicates + * that this origin is 'Private'. + * @return the next definition stage. + */ + WithCreate withPrivateLinkAlias(String privateLinkAlias); + } + /** The stage of the Origin definition allowing to specify privateLinkResourceId. */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating + * this optional field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId The Resource Id of the Private Link resource. Populating this optional field + * indicates that this backend is 'Private'. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceId(String privateLinkResourceId); + } + /** The stage of the Origin definition allowing to specify privateLinkLocation. */ + interface WithPrivateLinkLocation { + /** + * Specifies the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * @return the next definition stage. + */ + WithCreate withPrivateLinkLocation(String privateLinkLocation); + } + /** The stage of the Origin definition allowing to specify privateLinkApprovalMessage. */ + interface WithPrivateLinkApprovalMessage { + /** + * Specifies the privateLinkApprovalMessage property: A custom message to be included in the approval + * request to connect to the Private Link.. + * + * @param privateLinkApprovalMessage A custom message to be included in the approval request to connect to + * the Private Link. + * @return the next definition stage. + */ + WithCreate withPrivateLinkApprovalMessage(String privateLinkApprovalMessage); + } + } + /** + * Begins update for the Origin resource. + * + * @return the stage of resource update. + */ + Origin.Update update(); + + /** The template for Origin update. */ + interface Update + extends UpdateStages.WithHostname, + UpdateStages.WithHttpPort, + UpdateStages.WithHttpsPort, + UpdateStages.WithOriginHostHeader, + UpdateStages.WithPriority, + UpdateStages.WithWeight, + UpdateStages.WithEnabled, + UpdateStages.WithPrivateLinkAlias, + UpdateStages.WithPrivateLinkResourceId, + UpdateStages.WithPrivateLinkLocation, + UpdateStages.WithPrivateLinkApprovalMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Origin apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Origin apply(Context context); + } + /** The Origin update stages. */ + interface UpdateStages { + /** The stage of the Origin update allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 + * addresses are supported.This should be unique across all origins in an endpoint.. + * + * @param hostname The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + /** The stage of the Origin update allowing to specify httpPort. */ + interface WithHttpPort { + /** + * Specifies the httpPort property: The value of the HTTP port. Must be between 1 and 65535.. + * + * @param httpPort The value of the HTTP port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpPort(Integer httpPort); + } + /** The stage of the Origin update allowing to specify httpsPort. */ + interface WithHttpsPort { + /** + * Specifies the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535.. + * + * @param httpsPort The value of the HTTPS port. Must be between 1 and 65535. + * @return the next definition stage. + */ + Update withHttpsPort(Integer httpsPort); + } + /** The stage of the Origin update allowing to specify originHostHeader. */ + interface WithOriginHostHeader { + /** + * Specifies the originHostHeader property: The host header value sent to the origin with each request. If + * you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, + * Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + * This overrides the host header defined at Endpoint. + * + * @param originHostHeader The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, + * and Cloud Services require this host header value to match the origin hostname by default. This + * overrides the host header defined at Endpoint. + * @return the next definition stage. + */ + Update withOriginHostHeader(String originHostHeader); + } + /** The stage of the Origin update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of origin in given origin group for load balancing. Higher + * priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + * and 5. + * + * @param priority Priority of origin in given origin group for load balancing. Higher priorities will not + * be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the Origin update allowing to specify weight. */ + interface WithWeight { + /** + * Specifies the weight property: Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000. + * + * @param weight Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. + * @return the next definition stage. + */ + Update withWeight(Integer weight); + } + /** The stage of the Origin update allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled Origin is enabled for load balancing or not. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + /** The stage of the Origin update allowing to specify privateLinkAlias. */ + interface WithPrivateLinkAlias { + /** + * Specifies the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional + * field indicates that this origin is 'Private'. + * + * @param privateLinkAlias The Alias of the Private Link resource. Populating this optional field indicates + * that this origin is 'Private'. + * @return the next definition stage. + */ + Update withPrivateLinkAlias(String privateLinkAlias); + } + /** The stage of the Origin update allowing to specify privateLinkResourceId. */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating + * this optional field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId The Resource Id of the Private Link resource. Populating this optional field + * indicates that this backend is 'Private'. + * @return the next definition stage. + */ + Update withPrivateLinkResourceId(String privateLinkResourceId); + } + /** The stage of the Origin update allowing to specify privateLinkLocation. */ + interface WithPrivateLinkLocation { + /** + * Specifies the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * @return the next definition stage. + */ + Update withPrivateLinkLocation(String privateLinkLocation); + } + /** The stage of the Origin update allowing to specify privateLinkApprovalMessage. */ + interface WithPrivateLinkApprovalMessage { + /** + * Specifies the privateLinkApprovalMessage property: A custom message to be included in the approval + * request to connect to the Private Link.. + * + * @param privateLinkApprovalMessage A custom message to be included in the approval request to connect to + * the Private Link. + * @return the next definition stage. + */ + Update withPrivateLinkApprovalMessage(String privateLinkApprovalMessage); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Origin refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Origin refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java new file mode 100644 index 0000000000000..c353ba534dad7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import java.util.List; + +/** An immutable client-side representation of OriginGroup. */ +public interface OriginGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the origin group. + * + * @return the resourceState value. + */ + OriginGroupResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the origin group. + * + * @return the provisioningState value. + */ + OriginGroupProvisioningState provisioningState(); + + /** + * Gets the healthProbeSettings property: Health probe settings to the origin that is used to determine the health + * of the origin. + * + * @return the healthProbeSettings value. + */ + HealthProbeParameters healthProbeSettings(); + + /** + * Gets the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + List origins(); + + /** + * Gets the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + + /** + * Gets the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner object. + * + * @return the inner object. + */ + OriginGroupInner innerModel(); + + /** The entirety of the OriginGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The OriginGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the OriginGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the OriginGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingEndpoint(String resourceGroupName, String profileName, String endpointName); + } + /** + * The stage of the OriginGroup 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.WithHealthProbeSettings, + DefinitionStages.WithOrigins, + DefinitionStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + DefinitionStages.WithResponseBasedOriginErrorDetectionSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + OriginGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OriginGroup create(Context context); + } + /** The stage of the OriginGroup definition allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + WithCreate withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + /** The stage of the OriginGroup definition allowing to specify origins. */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN within given origin + * group.. + * + * @param origins The source of the content being delivered via CDN within given origin group. + * @return the next definition stage. + */ + WithCreate withOrigins(List origins); + } + /** + * The stage of the OriginGroup definition allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + /** The stage of the OriginGroup definition allowing to specify responseBasedOriginErrorDetectionSettings. */ + interface WithResponseBasedOriginErrorDetectionSettings { + /** + * Specifies the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedOriginErrorDetectionSettings The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * @return the next definition stage. + */ + WithCreate withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings); + } + } + /** + * Begins update for the OriginGroup resource. + * + * @return the stage of resource update. + */ + OriginGroup.Update update(); + + /** The template for OriginGroup update. */ + interface Update + extends UpdateStages.WithHealthProbeSettings, + UpdateStages.WithOrigins, + UpdateStages.WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes, + UpdateStages.WithResponseBasedOriginErrorDetectionSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OriginGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OriginGroup apply(Context context); + } + /** The OriginGroup update stages. */ + interface UpdateStages { + /** The stage of the OriginGroup update allowing to specify healthProbeSettings. */ + interface WithHealthProbeSettings { + /** + * Specifies the healthProbeSettings property: Health probe settings to the origin that is used to determine + * the health of the origin.. + * + * @param healthProbeSettings Health probe settings to the origin that is used to determine the health of + * the origin. + * @return the next definition stage. + */ + Update withHealthProbeSettings(HealthProbeParameters healthProbeSettings); + } + /** The stage of the OriginGroup update allowing to specify origins. */ + interface WithOrigins { + /** + * Specifies the origins property: The source of the content being delivered via CDN within given origin + * group.. + * + * @param origins The source of the content being delivered via CDN within given origin group. + * @return the next definition stage. + */ + Update withOrigins(List origins); + } + /** + * The stage of the OriginGroup update allowing to specify + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes. + */ + interface WithTrafficRestorationTimeToHealedOrNewEndpointsInMinutes { + /** + * Specifies the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift + * the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is + * added. Default is 10 mins. This property is currently not supported.. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the + * endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 + * mins. This property is currently not supported. + * @return the next definition stage. + */ + Update withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + } + /** The stage of the OriginGroup update allowing to specify responseBasedOriginErrorDetectionSettings. */ + interface WithResponseBasedOriginErrorDetectionSettings { + /** + * Specifies the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedOriginErrorDetectionSettings The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * @return the next definition stage. + */ + Update withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OriginGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OriginGroup refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java new file mode 100644 index 0000000000000..be0ab023b5db2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the + * next set of results. + */ +@Fluent +public final class OriginGroupListResult { + /* + * List of CDN origin groups within an endpoint + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OriginGroupListResult class. */ + public OriginGroupListResult() { + } + + /** + * Get the value property: List of CDN origin groups within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OriginGroupListResult object itself. + */ + public OriginGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.java new file mode 100644 index 0000000000000..56ec871f195ba --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverride.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the origin group override configuration. */ +@Fluent +public final class OriginGroupOverride { + /* + * defines the OriginGroup that would override the DefaultOriginGroup on route. + */ + @JsonProperty(value = "originGroup") + private ResourceReference originGroup; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + @JsonProperty(value = "forwardingProtocol") + private ForwardingProtocol forwardingProtocol; + + /** Creates an instance of OriginGroupOverride class. */ + public OriginGroupOverride() { + } + + /** + * Get the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup on route. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.originGroup; + } + + /** + * Set the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup on route. + * + * @param originGroup the originGroup value to set. + * @return the OriginGroupOverride object itself. + */ + public OriginGroupOverride withOriginGroup(ResourceReference originGroup) { + this.originGroup = originGroup; + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.forwardingProtocol; + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the OriginGroupOverride object itself. + */ + public OriginGroupOverride withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + this.forwardingProtocol = forwardingProtocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (originGroup() != null) { + originGroup().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.java new file mode 100644 index 0000000000000..24ee117762777 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the origin group override action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("OriginGroupOverride") +@Fluent +public final class OriginGroupOverrideAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private OriginGroupOverrideActionParameters parameters; + + /** Creates an instance of OriginGroupOverrideAction class. */ + public OriginGroupOverrideAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public OriginGroupOverrideActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the OriginGroupOverrideAction object itself. + */ + public OriginGroupOverrideAction withParameters(OriginGroupOverrideActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameters in model OriginGroupOverrideAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupOverrideAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.java new file mode 100644 index 0000000000000..a9f3b589bc820 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the origin group override action. */ +@Fluent +public final class OriginGroupOverrideActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleOriginGroupOverrideActionParameters"; + + /* + * defines the OriginGroup that would override the DefaultOriginGroup. + */ + @JsonProperty(value = "originGroup", required = true) + private ResourceReference originGroup; + + /** Creates an instance of OriginGroupOverrideActionParameters class. */ + public OriginGroupOverrideActionParameters() { + typeName = "DeliveryRuleOriginGroupOverrideActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the OriginGroupOverrideActionParameters object itself. + */ + public OriginGroupOverrideActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.originGroup; + } + + /** + * Set the originGroup property: defines the OriginGroup that would override the DefaultOriginGroup. + * + * @param originGroup the originGroup value to set. + * @return the OriginGroupOverrideActionParameters object itself. + */ + public OriginGroupOverrideActionParameters withOriginGroup(ResourceReference originGroup) { + this.originGroup = originGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (originGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property originGroup in model OriginGroupOverrideActionParameters")); + } else { + originGroup().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OriginGroupOverrideActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java new file mode 100644 index 0000000000000..3707e6df5a772 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the origin group. */ +public final class OriginGroupProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for OriginGroupProvisioningState. */ + public static final OriginGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OriginGroupProvisioningState. */ + public static final OriginGroupProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for OriginGroupProvisioningState. */ + public static final OriginGroupProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for OriginGroupProvisioningState. */ + public static final OriginGroupProvisioningState DELETING = fromString("Deleting"); + + /** Static value Creating for OriginGroupProvisioningState. */ + public static final OriginGroupProvisioningState CREATING = fromString("Creating"); + + /** + * Creates or finds a OriginGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginGroupProvisioningState. + */ + @JsonCreator + public static OriginGroupProvisioningState fromString(String name) { + return fromString(name, OriginGroupProvisioningState.class); + } + + /** + * Gets known OriginGroupProvisioningState values. + * + * @return known OriginGroupProvisioningState values. + */ + public static Collection values() { + return values(OriginGroupProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java new file mode 100644 index 0000000000000..a8ad9771ef3b7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the origin group. */ +public final class OriginGroupResourceState extends ExpandableStringEnum { + /** Static value Creating for OriginGroupResourceState. */ + public static final OriginGroupResourceState CREATING = fromString("Creating"); + + /** Static value Active for OriginGroupResourceState. */ + public static final OriginGroupResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for OriginGroupResourceState. */ + public static final OriginGroupResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a OriginGroupResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginGroupResourceState. + */ + @JsonCreator + public static OriginGroupResourceState fromString(String name) { + return fromString(name, OriginGroupResourceState.class); + } + + /** + * Gets known OriginGroupResourceState values. + * + * @return known OriginGroupResourceState values. + */ + public static Collection values() { + return values(OriginGroupResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java new file mode 100644 index 0000000000000..3ee128b24c996 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Origin group properties needed for origin group creation or update. */ +@Fluent +public final class OriginGroupUpdateParameters { + /* + * The JSON object that contains the properties of the origin group. + */ + @JsonProperty(value = "properties") + private OriginGroupUpdatePropertiesParameters innerProperties; + + /** Creates an instance of OriginGroupUpdateParameters class. */ + public OriginGroupUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin group. + * + * @return the innerProperties value. + */ + private OriginGroupUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @return the healthProbeSettings value. + */ + public HealthProbeParameters healthProbeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().healthProbeSettings(); + } + + /** + * Set the healthProbeSettings property: Health probe settings to the origin that is used to determine the health of + * the origin. + * + * @param healthProbeSettings the healthProbeSettings value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withHealthProbeSettings(HealthProbeParameters healthProbeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withHealthProbeSettings(healthProbeSettings); + return this; + } + + /** + * Get the origins property: The source of the content being delivered via CDN within given origin group. + * + * @return the origins value. + */ + public List origins() { + return this.innerProperties() == null ? null : this.innerProperties().origins(); + } + + /** + * Set the origins property: The source of the content being delivered via CDN within given origin group. + * + * @param origins the origins value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withOrigins(List origins) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withOrigins(origins); + return this; + } + + /** + * Get the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @return the trafficRestorationTimeToHealedOrNewEndpointsInMinutes value. + */ + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerProperties() == null + ? null + : this.innerProperties().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + /** + * Set the trafficRestorationTimeToHealedOrNewEndpointsInMinutes property: Time in minutes to shift the traffic to + * the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. + * This property is currently not supported. + * + * @param trafficRestorationTimeToHealedOrNewEndpointsInMinutes the + * trafficRestorationTimeToHealedOrNewEndpointsInMinutes value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this + .innerProperties() + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + trafficRestorationTimeToHealedOrNewEndpointsInMinutes); + return this; + } + + /** + * Get the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings() { + return this.innerProperties() == null + ? null + : this.innerProperties().responseBasedOriginErrorDetectionSettings(); + } + + /** + * Set the responseBasedOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedOriginErrorDetectionSettings the responseBasedOriginErrorDetectionSettings value to set. + * @return the OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginGroupUpdatePropertiesParameters(); + } + this.innerProperties().withResponseBasedOriginErrorDetectionSettings(responseBasedOriginErrorDetectionSettings); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroups.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroups.java new file mode 100644 index 0000000000000..9e6feb515e6f7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroups.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 OriginGroups. */ +public interface OriginGroups { + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origin groups within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origin groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 an existing origin group within an endpoint along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin group within an endpoint. + */ + OriginGroup get(String resourceGroupName, String profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String originGroupName); + + /** + * Deletes an existing origin group within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originGroupName Name of the origin group which is unique within the endpoint. + * @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 profileName, String endpointName, String originGroupName, Context context); + + /** + * Gets an existing origin group within an endpoint. + * + * @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 an existing origin group within an endpoint along with {@link Response}. + */ + OriginGroup getById(String id); + + /** + * Gets an existing origin group within an endpoint. + * + * @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 an existing origin group within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin group within an endpoint. + * + * @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 an existing origin group within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OriginGroup resource. + * + * @param name resource name. + * @return the first stage of the new OriginGroup definition. + */ + OriginGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java new file mode 100644 index 0000000000000..2211ad6eb9021 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class OriginListResult { + /* + * List of CDN origins within an endpoint + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of origin objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OriginListResult class. */ + public OriginListResult() { + } + + /** + * Get the value property: List of CDN origins within an endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of origin objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of origin objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OriginListResult object itself. + */ + public OriginListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java new file mode 100644 index 0000000000000..32cd2190ef986 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the origin. */ +public final class OriginProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for OriginProvisioningState. */ + public static final OriginProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OriginProvisioningState. */ + public static final OriginProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for OriginProvisioningState. */ + public static final OriginProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for OriginProvisioningState. */ + public static final OriginProvisioningState DELETING = fromString("Deleting"); + + /** Static value Creating for OriginProvisioningState. */ + public static final OriginProvisioningState CREATING = fromString("Creating"); + + /** + * Creates or finds a OriginProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginProvisioningState. + */ + @JsonCreator + public static OriginProvisioningState fromString(String name) { + return fromString(name, OriginProvisioningState.class); + } + + /** + * Gets known OriginProvisioningState values. + * + * @return known OriginProvisioningState values. + */ + public static Collection values() { + return values(OriginProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java new file mode 100644 index 0000000000000..7e65db15e2c3f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the origin. */ +public final class OriginResourceState extends ExpandableStringEnum { + /** Static value Creating for OriginResourceState. */ + public static final OriginResourceState CREATING = fromString("Creating"); + + /** Static value Active for OriginResourceState. */ + public static final OriginResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for OriginResourceState. */ + public static final OriginResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a OriginResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OriginResourceState. + */ + @JsonCreator + public static OriginResourceState fromString(String name) { + return fromString(name, OriginResourceState.class); + } + + /** + * Gets known OriginResourceState values. + * + * @return known OriginResourceState values. + */ + public static Collection values() { + return values(OriginResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java new file mode 100644 index 0000000000000..0502f96426f76 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Origin properties needed for origin update. */ +@Fluent +public final class OriginUpdateParameters { + /* + * The JSON object that contains the properties of the origin. + */ + @JsonProperty(value = "properties") + private OriginUpdatePropertiesParameters innerProperties; + + /** Creates an instance of OriginUpdateParameters class. */ + public OriginUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the origin. + * + * @return the innerProperties value. + */ + private OriginUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are + * supported.This should be unique across all origins in an endpoint. + * + * @param hostname the hostname value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpPort(); + } + + /** + * Set the httpPort property: The value of the HTTP port. Must be between 1 and 65535. + * + * @param httpPort the httpPort value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpPort(Integer httpPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpPort(httpPort); + return this; + } + + /** + * Get the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().httpsPort(); + } + + /** + * Set the httpsPort property: The value of the HTTPS port. Must be between 1 and 65535. + * + * @param httpsPort the httpsPort value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withHttpsPort(Integer httpsPort) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsPort(httpsPort); + return this; + } + + /** + * Get the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @return the originHostHeader value. + */ + public String originHostHeader() { + return this.innerProperties() == null ? null : this.innerProperties().originHostHeader(); + } + + /** + * Set the originHostHeader property: The host header value sent to the origin with each request. If you leave this + * blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud + * Services require this host header value to match the origin hostname by default. This overrides the host header + * defined at Endpoint. + * + * @param originHostHeader the originHostHeader value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withOriginHostHeader(String originHostHeader) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withOriginHostHeader(originHostHeader); + return this; + } + + /** + * Get the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of origin in given origin group for load balancing. Higher priorities will + * not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + * + * @param priority the priority value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @return the weight value. + */ + public Integer weight() { + return this.innerProperties() == null ? null : this.innerProperties().weight(); + } + + /** + * Set the weight property: Weight of the origin in given origin group for load balancing. Must be between 1 and + * 1000. + * + * @param weight the weight value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withWeight(Integer weight) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withWeight(weight); + return this; + } + + /** + * Get the enabled property: Origin is enabled for load balancing or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Origin is enabled for load balancing or not. + * + * @param enabled the enabled value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @return the privateLinkAlias value. + */ + public String privateLinkAlias() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkAlias(); + } + + /** + * Set the privateLinkAlias property: The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private'. + * + * @param privateLinkAlias the privateLinkAlias value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkAlias(String privateLinkAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkAlias(privateLinkAlias); + return this; + } + + /** + * Get the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private'. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkLocation(); + } + + /** + * Set the privateLinkLocation property: The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkLocation(String privateLinkLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkLocation(privateLinkLocation); + return this; + } + + /** + * Get the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @return the privateLinkApprovalMessage value. + */ + public String privateLinkApprovalMessage() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkApprovalMessage(); + } + + /** + * Set the privateLinkApprovalMessage property: A custom message to be included in the approval request to connect + * to the Private Link. + * + * @param privateLinkApprovalMessage the privateLinkApprovalMessage value to set. + * @return the OriginUpdateParameters object itself. + */ + public OriginUpdateParameters withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new OriginUpdatePropertiesParameters(); + } + this.innerProperties().withPrivateLinkApprovalMessage(privateLinkApprovalMessage); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origins.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origins.java new file mode 100644 index 0000000000000..536540c5e54f7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origins.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Origins. */ +public interface Origins { + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list origins as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @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 an existing origin within an endpoint along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing origin within an endpoint. + */ + Origin get(String resourceGroupName, String profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String originName); + + /** + * Deletes an existing origin within an endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param originName Name of the origin which is unique within the endpoint. + * @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 profileName, String endpointName, String originName, Context context); + + /** + * Gets an existing origin within an endpoint. + * + * @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 an existing origin within an endpoint along with {@link Response}. + */ + Origin getById(String id); + + /** + * Gets an existing origin within an endpoint. + * + * @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 an existing origin within an endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing origin within an endpoint. + * + * @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 an existing origin within an endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Origin resource. + * + * @param name resource name. + * @return the first stage of the new Origin definition. + */ + Origin.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java new file mode 100644 index 0000000000000..090660b9749ed --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates the purpose of the parameter. */ +public final class ParamIndicator extends ExpandableStringEnum { + /** Static value Expires for ParamIndicator. */ + public static final ParamIndicator EXPIRES = fromString("Expires"); + + /** Static value KeyId for ParamIndicator. */ + public static final ParamIndicator KEY_ID = fromString("KeyId"); + + /** Static value Signature for ParamIndicator. */ + public static final ParamIndicator SIGNATURE = fromString("Signature"); + + /** + * Creates or finds a ParamIndicator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ParamIndicator. + */ + @JsonCreator + public static ParamIndicator fromString(String name) { + return fromString(name, ParamIndicator.class); + } + + /** + * Gets known ParamIndicator values. + * + * @return known ParamIndicator values. + */ + public static Collection values() { + return values(ParamIndicator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java new file mode 100644 index 0000000000000..bba54d7ea686f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Policies. */ +public interface Policies { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a list of WebApplicationFirewallPolicies for Azure CDN as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @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 defines web application firewall policy for Azure CDN along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy for Azure CDN. + */ + CdnWebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param policyName The name of the CdnWebApplicationFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @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 defines web application firewall policy for Azure CDN along with {@link Response}. + */ + CdnWebApplicationFirewallPolicy getById(String id); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @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 defines web application firewall policy for Azure CDN along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes Policy. + * + * @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 Policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CdnWebApplicationFirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new CdnWebApplicationFirewallPolicy definition. + */ + CdnWebApplicationFirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java new file mode 100644 index 0000000000000..57b49005470fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** describes if the policy is in enabled state or disabled state. */ +public final class PolicyEnabledState extends ExpandableStringEnum { + /** Static value Disabled for PolicyEnabledState. */ + public static final PolicyEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for PolicyEnabledState. */ + public static final PolicyEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a PolicyEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyEnabledState. + */ + @JsonCreator + public static PolicyEnabledState fromString(String name) { + return fromString(name, PolicyEnabledState.class); + } + + /** + * Gets known PolicyEnabledState values. + * + * @return known PolicyEnabledState values. + */ + public static Collection values() { + return values(PolicyEnabledState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java new file mode 100644 index 0000000000000..466b713f2e9b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes if it is in detection mode or prevention mode at policy level. */ +public final class PolicyMode extends ExpandableStringEnum { + /** Static value Prevention for PolicyMode. */ + public static final PolicyMode PREVENTION = fromString("Prevention"); + + /** Static value Detection for PolicyMode. */ + public static final PolicyMode DETECTION = fromString("Detection"); + + /** + * Creates or finds a PolicyMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyMode. + */ + @JsonCreator + public static PolicyMode fromString(String name) { + return fromString(name, PolicyMode.class); + } + + /** + * Gets known PolicyMode values. + * + * @return known PolicyMode values. + */ + public static Collection values() { + return values(PolicyMode.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java new file mode 100644 index 0000000000000..e9837e5babd48 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the policy. */ +public final class PolicyResourceState extends ExpandableStringEnum { + /** Static value Creating for PolicyResourceState. */ + public static final PolicyResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for PolicyResourceState. */ + public static final PolicyResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for PolicyResourceState. */ + public static final PolicyResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for PolicyResourceState. */ + public static final PolicyResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for PolicyResourceState. */ + public static final PolicyResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for PolicyResourceState. */ + public static final PolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a PolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyResourceState. + */ + @JsonCreator + public static PolicyResourceState fromString(String name) { + return fromString(name, PolicyResourceState.class); + } + + /** + * Gets known PolicyResourceState values. + * + * @return known PolicyResourceState values. + */ + public static Collection values() { + return values(PolicyResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java new file mode 100644 index 0000000000000..9b13368793f40 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines contents of a web application firewall global configuration. */ +@Fluent +public final class PolicySettings { + /* + * describes if the policy is in enabled state or disabled state + */ + @JsonProperty(value = "enabledState") + private PolicyEnabledState enabledState; + + /* + * Describes if it is in detection mode or prevention mode at policy level. + */ + @JsonProperty(value = "mode") + private PolicyMode mode; + + /* + * If action type is redirect, this field represents the default redirect URL for the client. + */ + @JsonProperty(value = "defaultRedirectUrl") + private String defaultRedirectUrl; + + /* + * If the action type is block, this field defines the default customer overridable http response status code. + */ + @JsonProperty(value = "defaultCustomBlockResponseStatusCode") + private PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode; + + /* + * If the action type is block, customer can override the response body. The body must be specified in base64 + * encoding. + */ + @JsonProperty(value = "defaultCustomBlockResponseBody") + private String defaultCustomBlockResponseBody; + + /** Creates an instance of PolicySettings class. */ + public PolicySettings() { + } + + /** + * Get the enabledState property: describes if the policy is in enabled state or disabled state. + * + * @return the enabledState value. + */ + public PolicyEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: describes if the policy is in enabled state or disabled state. + * + * @param enabledState the enabledState value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withEnabledState(PolicyEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the mode property: Describes if it is in detection mode or prevention mode at policy level. + * + * @return the mode value. + */ + public PolicyMode mode() { + return this.mode; + } + + /** + * Set the mode property: Describes if it is in detection mode or prevention mode at policy level. + * + * @param mode the mode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(PolicyMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL + * for the client. + * + * @return the defaultRedirectUrl value. + */ + public String defaultRedirectUrl() { + return this.defaultRedirectUrl; + } + + /** + * Set the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL + * for the client. + * + * @param defaultRedirectUrl the defaultRedirectUrl value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultRedirectUrl(String defaultRedirectUrl) { + this.defaultRedirectUrl = defaultRedirectUrl; + return this; + } + + /** + * Get the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the + * default customer overridable http response status code. + * + * @return the defaultCustomBlockResponseStatusCode value. + */ + public PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode() { + return this.defaultCustomBlockResponseStatusCode; + } + + /** + * Set the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the + * default customer overridable http response status code. + * + * @param defaultCustomBlockResponseStatusCode the defaultCustomBlockResponseStatusCode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode) { + this.defaultCustomBlockResponseStatusCode = defaultCustomBlockResponseStatusCode; + return this; + } + + /** + * Get the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response + * body. The body must be specified in base64 encoding. + * + * @return the defaultCustomBlockResponseBody value. + */ + public String defaultCustomBlockResponseBody() { + return this.defaultCustomBlockResponseBody; + } + + /** + * Set the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response + * body. The body must be specified in base64 encoding. + * + * @param defaultCustomBlockResponseBody the defaultCustomBlockResponseBody value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withDefaultCustomBlockResponseBody(String defaultCustomBlockResponseBody) { + this.defaultCustomBlockResponseBody = defaultCustomBlockResponseBody; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.java new file mode 100644 index 0000000000000..b2c1952670201 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** If the action type is block, this field defines the default customer overridable http response status code. */ +public final class PolicySettingsDefaultCustomBlockResponseStatusCode + extends ExpandableStringEnum { + /** Static value 200 for PolicySettingsDefaultCustomBlockResponseStatusCode. */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode TWO_ZERO_ZERO = fromInt(200); + + /** Static value 403 for PolicySettingsDefaultCustomBlockResponseStatusCode. */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_THREE = fromInt(403); + + /** Static value 405 for PolicySettingsDefaultCustomBlockResponseStatusCode. */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_FIVE = fromInt(405); + + /** Static value 406 for PolicySettingsDefaultCustomBlockResponseStatusCode. */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_ZERO_SIX = fromInt(406); + + /** Static value 429 for PolicySettingsDefaultCustomBlockResponseStatusCode. */ + public static final PolicySettingsDefaultCustomBlockResponseStatusCode FOUR_TWO_NINE = fromInt(429); + + /** + * Creates or finds a PolicySettingsDefaultCustomBlockResponseStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicySettingsDefaultCustomBlockResponseStatusCode. + */ + @JsonCreator + public static PolicySettingsDefaultCustomBlockResponseStatusCode fromInt(int name) { + return fromString(String.valueOf(name), PolicySettingsDefaultCustomBlockResponseStatusCode.class); + } + + /** + * Gets known PolicySettingsDefaultCustomBlockResponseStatusCode values. + * + * @return known PolicySettingsDefaultCustomBlockResponseStatusCode values. + */ + public static Collection values() { + return values(PolicySettingsDefaultCustomBlockResponseStatusCode.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java new file mode 100644 index 0000000000000..2233a6e41b987 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for PostArgs match conditions. */ +@Fluent +public final class PostArgsMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRulePostArgsConditionParameters"; + + /* + * Name of PostArg to be matched + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private PostArgsOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of PostArgsMatchConditionParameters class. */ + public PostArgsMatchConditionParameters() { + typeName = "DeliveryRulePostArgsConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the selector property: Name of PostArg to be matched. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Name of PostArg to be matched. + * + * @param selector the selector value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public PostArgsOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withOperator(PostArgsOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model PostArgsMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PostArgsMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.java new file mode 100644 index 0000000000000..c7aa16fc98afb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class PostArgsOperator extends ExpandableStringEnum { + /** Static value Any for PostArgsOperator. */ + public static final PostArgsOperator ANY = fromString("Any"); + + /** Static value Equal for PostArgsOperator. */ + public static final PostArgsOperator EQUAL = fromString("Equal"); + + /** Static value Contains for PostArgsOperator. */ + public static final PostArgsOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for PostArgsOperator. */ + public static final PostArgsOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for PostArgsOperator. */ + public static final PostArgsOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for PostArgsOperator. */ + public static final PostArgsOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for PostArgsOperator. */ + public static final PostArgsOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for PostArgsOperator. */ + public static final PostArgsOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for PostArgsOperator. */ + public static final PostArgsOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for PostArgsOperator. */ + public static final PostArgsOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a PostArgsOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding PostArgsOperator. + */ + @JsonCreator + public static PostArgsOperator fromString(String name) { + return fromString(name, PostArgsOperator.class); + } + + /** + * Gets known PostArgsOperator values. + * + * @return known PostArgsOperator values. + */ + public static Collection values() { + return values(PostArgsOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java new file mode 100644 index 0000000000000..09b5936fd7a55 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The approval status for the connection to the Private Link. */ +public final class PrivateEndpointStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Timeout for PrivateEndpointStatus. */ + public static final PrivateEndpointStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a PrivateEndpointStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointStatus. + */ + @JsonCreator + public static PrivateEndpointStatus fromString(String name) { + return fromString(name, PrivateEndpointStatus.class); + } + + /** + * Gets known PrivateEndpointStatus values. + * + * @return known PrivateEndpointStatus values. + */ + public static Collection values() { + return values(PrivateEndpointStatus.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.java new file mode 100644 index 0000000000000..71bae9d8d3501 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Protocol to use for health probe. */ +public enum ProbeProtocol { + /** Enum value NotSet. */ + NOT_SET("NotSet"), + + /** Enum value Http. */ + HTTP("Http"), + + /** Enum value Https. */ + HTTPS("Https"); + + /** The actual serialized value for a ProbeProtocol instance. */ + private final String value; + + ProbeProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProbeProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed ProbeProtocol object, or null if unable to parse. + */ + @JsonCreator + public static ProbeProtocol fromString(String value) { + if (value == null) { + return null; + } + ProbeProtocol[] items = ProbeProtocol.values(); + for (ProbeProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.java new file mode 100644 index 0000000000000..a66299c23cb80 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import java.util.Map; + +/** An immutable client-side representation of Profile. */ +public interface Profile { + /** + * 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 sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature + * list and rate) of the profile. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the kind property: Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD + * profile. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceState property: Resource status of the profile. + * + * @return the resourceState value. + */ + ProfileResourceState resourceState(); + + /** + * Gets the provisioningState property: Provisioning status of the profile. + * + * @return the provisioningState value. + */ + ProfileProvisioningState provisioningState(); + + /** + * Gets the extendedProperties property: Key-Value pair representing additional properties for profiles. + * + * @return the extendedProperties value. + */ + Map extendedProperties(); + + /** + * Gets the frontDoorId property: The Id of the frontdoor. + * + * @return the frontDoorId value. + */ + String frontDoorId(); + + /** + * Gets the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. + * When timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + Integer originResponseTimeoutSeconds(); + + /** + * 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.cdn.generated.fluent.models.ProfileInner object. + * + * @return the inner object. + */ + ProfileInner innerModel(); + + /** The entirety of the Profile definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Profile definition stages. */ + interface DefinitionStages { + /** The first stage of the Profile definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Profile 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 Profile definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Profile definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The pricing tier (defines Azure Front Door Standard or Premium or a CDN + * provider, feature list and rate) of the profile.. + * + * @param sku The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list + * and rate) of the profile. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the Profile definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithExtendedProperties, + DefinitionStages.WithOriginResponseTimeoutSeconds { + /** + * Executes the create request. + * + * @return the created resource. + */ + Profile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Profile create(Context context); + } + /** The stage of the Profile 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 Profile definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities).. + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Profile definition allowing to specify extendedProperties. */ + interface WithExtendedProperties { + /** + * Specifies the extendedProperties property: Key-Value pair representing additional properties for + * profiles.. + * + * @param extendedProperties Key-Value pair representing additional properties for profiles. + * @return the next definition stage. + */ + WithCreate withExtendedProperties(Map extendedProperties); + } + /** The stage of the Profile definition allowing to specify originResponseTimeoutSeconds. */ + interface WithOriginResponseTimeoutSeconds { + /** + * Specifies the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to + * the origin. When timeout is reached, the request fails and returns.. + * + * @param originResponseTimeoutSeconds Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * @return the next definition stage. + */ + WithCreate withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds); + } + } + /** + * Begins update for the Profile resource. + * + * @return the stage of resource update. + */ + Profile.Update update(); + + /** The template for Profile update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithOriginResponseTimeoutSeconds { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Profile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Profile apply(Context context); + } + /** The Profile update stages. */ + interface UpdateStages { + /** The stage of the Profile update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Profile tags. + * + * @param tags Profile tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Profile update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities).. + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Profile update allowing to specify originResponseTimeoutSeconds. */ + interface WithOriginResponseTimeoutSeconds { + /** + * Specifies the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to + * the origin. When timeout is reached, the request fails and returns.. + * + * @param originResponseTimeoutSeconds Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * @return the next definition stage. + */ + Update withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Profile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Profile refresh(Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @throws com.azure.core.management.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 migrationCommit(); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @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 migrationCommit(Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @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 URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + Response generateSsoUriWithResponse(Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + SsoUri generateSsoUri(); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @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 supported optimization types for the current profile along with {@link Response}. + */ + Response listSupportedOptimizationTypesWithResponse(Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + SupportedOptimizationTypesListResult listSupportedOptimizationTypes(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.java new file mode 100644 index 0000000000000..3886abf751a4e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileChangeSkuWafMapping.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters required for profile upgrade. */ +@Fluent +public final class ProfileChangeSkuWafMapping { + /* + * The security policy name. + */ + @JsonProperty(value = "securityPolicyName", required = true) + private String securityPolicyName; + + /* + * The new waf resource for the security policy to use. + */ + @JsonProperty(value = "changeToWafPolicy", required = true) + private ResourceReference changeToWafPolicy; + + /** Creates an instance of ProfileChangeSkuWafMapping class. */ + public ProfileChangeSkuWafMapping() { + } + + /** + * Get the securityPolicyName property: The security policy name. + * + * @return the securityPolicyName value. + */ + public String securityPolicyName() { + return this.securityPolicyName; + } + + /** + * Set the securityPolicyName property: The security policy name. + * + * @param securityPolicyName the securityPolicyName value to set. + * @return the ProfileChangeSkuWafMapping object itself. + */ + public ProfileChangeSkuWafMapping withSecurityPolicyName(String securityPolicyName) { + this.securityPolicyName = securityPolicyName; + return this; + } + + /** + * Get the changeToWafPolicy property: The new waf resource for the security policy to use. + * + * @return the changeToWafPolicy value. + */ + public ResourceReference changeToWafPolicy() { + return this.changeToWafPolicy; + } + + /** + * Set the changeToWafPolicy property: The new waf resource for the security policy to use. + * + * @param changeToWafPolicy the changeToWafPolicy value to set. + * @return the ProfileChangeSkuWafMapping object itself. + */ + public ProfileChangeSkuWafMapping withChangeToWafPolicy(ResourceReference changeToWafPolicy) { + this.changeToWafPolicy = changeToWafPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityPolicyName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property securityPolicyName in model ProfileChangeSkuWafMapping")); + } + if (changeToWafPolicy() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property changeToWafPolicy in model ProfileChangeSkuWafMapping")); + } else { + changeToWafPolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileChangeSkuWafMapping.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileListResult.java new file mode 100644 index 0000000000000..4249a6e6b8134 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class ProfileListResult { + /* + * List of CDN profiles within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of profile objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProfileListResult class. */ + public ProfileListResult() { + } + + /** + * Get the value property: List of CDN profiles within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of profile objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of profile objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ProfileListResult object itself. + */ + public ProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java new file mode 100644 index 0000000000000..bb0c210d90a4e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the profile. */ +public final class ProfileProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProfileProvisioningState. */ + public static final ProfileProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProfileProvisioningState. */ + public static final ProfileProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for ProfileProvisioningState. */ + public static final ProfileProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProfileProvisioningState. */ + public static final ProfileProvisioningState DELETING = fromString("Deleting"); + + /** Static value Creating for ProfileProvisioningState. */ + public static final ProfileProvisioningState CREATING = fromString("Creating"); + + /** + * Creates or finds a ProfileProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfileProvisioningState. + */ + @JsonCreator + public static ProfileProvisioningState fromString(String name) { + return fromString(name, ProfileProvisioningState.class); + } + + /** + * Gets known ProfileProvisioningState values. + * + * @return known ProfileProvisioningState values. + */ + public static Collection values() { + return values(ProfileProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.java new file mode 100644 index 0000000000000..99ca60afddc96 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Resource status of the profile. */ +public final class ProfileResourceState extends ExpandableStringEnum { + /** Static value Creating for ProfileResourceState. */ + public static final ProfileResourceState CREATING = fromString("Creating"); + + /** Static value Active for ProfileResourceState. */ + public static final ProfileResourceState ACTIVE = fromString("Active"); + + /** Static value Deleting for ProfileResourceState. */ + public static final ProfileResourceState DELETING = fromString("Deleting"); + + /** Static value Disabled for ProfileResourceState. */ + public static final ProfileResourceState DISABLED = fromString("Disabled"); + + /** Static value Migrating for ProfileResourceState. */ + public static final ProfileResourceState MIGRATING = fromString("Migrating"); + + /** Static value Migrated for ProfileResourceState. */ + public static final ProfileResourceState MIGRATED = fromString("Migrated"); + + /** Static value PendingMigrationCommit for ProfileResourceState. */ + public static final ProfileResourceState PENDING_MIGRATION_COMMIT = fromString("PendingMigrationCommit"); + + /** Static value CommittingMigration for ProfileResourceState. */ + public static final ProfileResourceState COMMITTING_MIGRATION = fromString("CommittingMigration"); + + /** Static value AbortingMigration for ProfileResourceState. */ + public static final ProfileResourceState ABORTING_MIGRATION = fromString("AbortingMigration"); + + /** + * Creates or finds a ProfileResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfileResourceState. + */ + @JsonCreator + public static ProfileResourceState fromString(String name) { + return fromString(name, ProfileResourceState.class); + } + + /** + * Gets known ProfileResourceState values. + * + * @return known ProfileResourceState values. + */ + public static Collection values() { + return values(ProfileResourceState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.java new file mode 100644 index 0000000000000..c1bcd50ef56a0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfilePropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to update a profile. */ +@Fluent +public final class ProfileUpdateParameters { + /* + * Profile tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Managed service identity (system assigned and/or user assigned identities). + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * The JSON object containing profile update parameters. + */ + @JsonProperty(value = "properties") + private ProfilePropertiesUpdateParameters innerProperties; + + /** Creates an instance of ProfileUpdateParameters class. */ + public ProfileUpdateParameters() { + } + + /** + * Get the tags property: Profile tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Profile tags. + * + * @param tags the tags value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The JSON object containing profile update parameters. + * + * @return the innerProperties value. + */ + private ProfilePropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @return the originResponseTimeoutSeconds value. + */ + public Integer originResponseTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().originResponseTimeoutSeconds(); + } + + /** + * Set the originResponseTimeoutSeconds property: Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + * + * @param originResponseTimeoutSeconds the originResponseTimeoutSeconds value to set. + * @return the ProfileUpdateParameters object itself. + */ + public ProfileUpdateParameters withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new ProfilePropertiesUpdateParameters(); + } + this.innerProperties().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.java new file mode 100644 index 0000000000000..d01a50fcde369 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpgradeParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for profile upgrade. */ +@Fluent +public final class ProfileUpgradeParameters { + /* + * Web Application Firewall (WAF) and security policy mapping for the profile upgrade + */ + @JsonProperty(value = "wafMappingList", required = true) + private List wafMappingList; + + /** Creates an instance of ProfileUpgradeParameters class. */ + public ProfileUpgradeParameters() { + } + + /** + * Get the wafMappingList property: Web Application Firewall (WAF) and security policy mapping for the profile + * upgrade. + * + * @return the wafMappingList value. + */ + public List wafMappingList() { + return this.wafMappingList; + } + + /** + * Set the wafMappingList property: Web Application Firewall (WAF) and security policy mapping for the profile + * upgrade. + * + * @param wafMappingList the wafMappingList value to set. + * @return the ProfileUpgradeParameters object itself. + */ + public ProfileUpgradeParameters withWafMappingList(List wafMappingList) { + this.wafMappingList = wafMappingList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (wafMappingList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property wafMappingList in model ProfileUpgradeParameters")); + } else { + wafMappingList().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProfileUpgradeParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java new file mode 100644 index 0000000000000..6b7307c36d29e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Profiles. */ +public interface Profiles { + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within a resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list profiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + */ + Profile getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String profileName); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String profileName, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation along with {@link Response}. + */ + Response canMigrateWithResponse( + String resourceGroupName, CanMigrateParameters canMigrateParameters, Context context); + + /** + * Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param canMigrateParameters Properties needed to check if cdn profile or classic frontdoor can be migrated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for canMigrate operation. + */ + CanMigrateResult canMigrate(String resourceGroupName, CanMigrateParameters canMigrateParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters); + + /** + * Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param migrationParameters Properties needed to migrate the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result for migrate operation. + */ + MigrateResult migrate(String resourceGroupName, MigrationParameters migrationParameters, Context context); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(String resourceGroupName, String profileName); + + /** + * Commit the migrated Azure Frontdoor(Standard/Premium) profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void migrationCommit(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal along with {@link Response}. + */ + Response generateSsoUriWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to + * configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a + * standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The + * SSO URI changes approximately every 10 minutes. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN profile which is unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the URI required to login to the supplemental portal from the Azure portal. + */ + SsoUri generateSsoUri(String resourceGroupName, String profileName); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile along with {@link Response}. + */ + Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization + * type from the listed values. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported optimization types for the current profile. + */ + SupportedOptimizationTypesListResult listSupportedOptimizationTypes(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or Azure Front Door + * Premium or CDN profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is + * unique within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @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 an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Profile getById(String id); + + /** + * Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group. + * + * @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 an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name + * under the specified subscription and resource group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @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 an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified + * parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, + * origins and custom domains. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Profile resource. + * + * @param name resource name. + * @return the first stage of the new Profile definition. + */ + Profile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java new file mode 100644 index 0000000000000..7f341a1ad899d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the TLS extension protocol that is used for secure delivery. */ +public final class ProtocolType extends ExpandableStringEnum { + /** Static value ServerNameIndication for ProtocolType. */ + public static final ProtocolType SERVER_NAME_INDICATION = fromString("ServerNameIndication"); + + /** Static value IPBased for ProtocolType. */ + public static final ProtocolType IPBASED = fromString("IPBased"); + + /** + * Creates or finds a ProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolType. + */ + @JsonCreator + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** + * Gets known ProtocolType values. + * + * @return known ProtocolType values. + */ + public static Collection values() { + return values(ProtocolType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..5656a5f3c43d8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the WebApplicationFirewallPolicy. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java new file mode 100644 index 0000000000000..0aa2865cc3647 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content purge. */ +@Fluent +public final class PurgeParameters { + /* + * The path to the content to be purged. Can describe a file path or a wild card directory. + */ + @JsonProperty(value = "contentPaths", required = true) + private List contentPaths; + + /** Creates an instance of PurgeParameters class. */ + public PurgeParameters() { + } + + /** + * Get the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @return the contentPaths value. + */ + public List contentPaths() { + return this.contentPaths; + } + + /** + * Set the contentPaths property: The path to the content to be purged. Can describe a file path or a wild card + * directory. + * + * @param contentPaths the contentPaths value to set. + * @return the PurgeParameters object itself. + */ + public PurgeParameters withContentPaths(List contentPaths) { + this.contentPaths = contentPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentPaths() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property contentPaths in model PurgeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PurgeParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.java new file mode 100644 index 0000000000000..b3a8cf1458836 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Caching behavior for the requests. */ +public final class QueryStringBehavior extends ExpandableStringEnum { + /** Static value Include for QueryStringBehavior. */ + public static final QueryStringBehavior INCLUDE = fromString("Include"); + + /** Static value IncludeAll for QueryStringBehavior. */ + public static final QueryStringBehavior INCLUDE_ALL = fromString("IncludeAll"); + + /** Static value Exclude for QueryStringBehavior. */ + public static final QueryStringBehavior EXCLUDE = fromString("Exclude"); + + /** Static value ExcludeAll for QueryStringBehavior. */ + public static final QueryStringBehavior EXCLUDE_ALL = fromString("ExcludeAll"); + + /** + * Creates or finds a QueryStringBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryStringBehavior. + */ + @JsonCreator + public static QueryStringBehavior fromString(String name) { + return fromString(name, QueryStringBehavior.class); + } + + /** + * Gets known QueryStringBehavior values. + * + * @return known QueryStringBehavior values. + */ + public static Collection values() { + return values(QueryStringBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java new file mode 100644 index 0000000000000..f1a5f4cf7de49 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass + * caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. + */ +public enum QueryStringCachingBehavior { + /** Enum value IgnoreQueryString. */ + IGNORE_QUERY_STRING("IgnoreQueryString"), + + /** Enum value BypassCaching. */ + BYPASS_CACHING("BypassCaching"), + + /** Enum value UseQueryString. */ + USE_QUERY_STRING("UseQueryString"), + + /** Enum value NotSet. */ + NOT_SET("NotSet"); + + /** The actual serialized value for a QueryStringCachingBehavior instance. */ + private final String value; + + QueryStringCachingBehavior(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryStringCachingBehavior instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryStringCachingBehavior object, or null if unable to parse. + */ + @JsonCreator + public static QueryStringCachingBehavior fromString(String value) { + if (value == null) { + return null; + } + QueryStringCachingBehavior[] items = QueryStringCachingBehavior.values(); + for (QueryStringCachingBehavior item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.java new file mode 100644 index 0000000000000..28004e1ded22e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for QueryString match conditions. */ +@Fluent +public final class QueryStringMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleQueryStringConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private QueryStringOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of QueryStringMatchConditionParameters class. */ + public QueryStringMatchConditionParameters() { + typeName = "DeliveryRuleQueryStringConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public QueryStringOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withOperator(QueryStringOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model QueryStringMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryStringMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.java new file mode 100644 index 0000000000000..15344cb8873dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class QueryStringOperator extends ExpandableStringEnum { + /** Static value Any for QueryStringOperator. */ + public static final QueryStringOperator ANY = fromString("Any"); + + /** Static value Equal for QueryStringOperator. */ + public static final QueryStringOperator EQUAL = fromString("Equal"); + + /** Static value Contains for QueryStringOperator. */ + public static final QueryStringOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for QueryStringOperator. */ + public static final QueryStringOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for QueryStringOperator. */ + public static final QueryStringOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for QueryStringOperator. */ + public static final QueryStringOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for QueryStringOperator. */ + public static final QueryStringOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for QueryStringOperator. */ + public static final QueryStringOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for QueryStringOperator. */ + public static final QueryStringOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for QueryStringOperator. */ + public static final QueryStringOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a QueryStringOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryStringOperator. + */ + @JsonCreator + public static QueryStringOperator fromString(String name) { + return fromString(name, QueryStringOperator.class); + } + + /** + * Gets known QueryStringOperator values. + * + * @return known QueryStringOperator values. + */ + public static Collection values() { + return values(QueryStringOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.java new file mode 100644 index 0000000000000..de34b7ad659cb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.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.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of RankingsResponse. */ +public interface RankingsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the tables property: The tables property. + * + * @return the tables value. + */ + List tables(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RankingsResponseInner object. + * + * @return the inner object. + */ + RankingsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesItem.java new file mode 100644 index 0000000000000..1dfa29a42022a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesItem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RankingsResponseTablesItem model. */ +@Fluent +public final class RankingsResponseTablesItem { + /* + * The ranking property. + */ + @JsonProperty(value = "ranking") + private String ranking; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** Creates an instance of RankingsResponseTablesItem class. */ + public RankingsResponseTablesItem() { + } + + /** + * Get the ranking property: The ranking property. + * + * @return the ranking value. + */ + public String ranking() { + return this.ranking; + } + + /** + * Set the ranking property: The ranking property. + * + * @param ranking the ranking value to set. + * @return the RankingsResponseTablesItem object itself. + */ + public RankingsResponseTablesItem withRanking(String ranking) { + this.ranking = ranking; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the RankingsResponseTablesItem object itself. + */ + public RankingsResponseTablesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (data() != null) { + data().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsItem.java new file mode 100644 index 0000000000000..95aa7aa288a34 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsItem.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RankingsResponseTablesPropertiesItemsItem model. */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The metrics property. + */ + @JsonProperty(value = "metrics") + private List metrics; + + /** Creates an instance of RankingsResponseTablesPropertiesItemsItem class. */ + public RankingsResponseTablesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the RankingsResponseTablesPropertiesItemsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the metrics property: The metrics property. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: The metrics property. + * + * @param metrics the metrics value to set. + * @return the RankingsResponseTablesPropertiesItemsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsItem withMetrics( + List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.java new file mode 100644 index 0000000000000..d0313e4e51450 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RankingsResponseTablesPropertiesItemsMetricsItem model. */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsMetricsItem { + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Long value; + + /* + * The percentage property. + */ + @JsonProperty(value = "percentage") + private Float percentage; + + /** Creates an instance of RankingsResponseTablesPropertiesItemsMetricsItem class. */ + public RankingsResponseTablesPropertiesItemsMetricsItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Long value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withValue(Long value) { + this.value = value; + return this; + } + + /** + * Get the percentage property: The percentage property. + * + * @return the percentage value. + */ + public Float percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage property. + * + * @param percentage the percentage value to set. + * @return the RankingsResponseTablesPropertiesItemsMetricsItem object itself. + */ + public RankingsResponseTablesPropertiesItemsMetricsItem withPercentage(Float percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRule.java new file mode 100644 index 0000000000000..890379397bc65 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRule.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a rate limiting rule that can be included in a waf policy. */ +@Fluent +public final class RateLimitRule extends CustomRule { + /* + * Defines rate limit threshold. + */ + @JsonProperty(value = "rateLimitThreshold", required = true) + private int rateLimitThreshold; + + /* + * Defines rate limit duration. Default is 1 minute. + */ + @JsonProperty(value = "rateLimitDurationInMinutes", required = true) + private int rateLimitDurationInMinutes; + + /** Creates an instance of RateLimitRule class. */ + public RateLimitRule() { + } + + /** + * Get the rateLimitThreshold property: Defines rate limit threshold. + * + * @return the rateLimitThreshold value. + */ + public int rateLimitThreshold() { + return this.rateLimitThreshold; + } + + /** + * Set the rateLimitThreshold property: Defines rate limit threshold. + * + * @param rateLimitThreshold the rateLimitThreshold value to set. + * @return the RateLimitRule object itself. + */ + public RateLimitRule withRateLimitThreshold(int rateLimitThreshold) { + this.rateLimitThreshold = rateLimitThreshold; + return this; + } + + /** + * Get the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute. + * + * @return the rateLimitDurationInMinutes value. + */ + public int rateLimitDurationInMinutes() { + return this.rateLimitDurationInMinutes; + } + + /** + * Set the rateLimitDurationInMinutes property: Defines rate limit duration. Default is 1 minute. + * + * @param rateLimitDurationInMinutes the rateLimitDurationInMinutes value to set. + * @return the RateLimitRule object itself. + */ + public RateLimitRule withRateLimitDurationInMinutes(int rateLimitDurationInMinutes) { + this.rateLimitDurationInMinutes = rateLimitDurationInMinutes; + return this; + } + + /** {@inheritDoc} */ + @Override + public RateLimitRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public RateLimitRule withEnabledState(CustomRuleEnabledState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** {@inheritDoc} */ + @Override + public RateLimitRule withPriority(int priority) { + super.withPriority(priority); + return this; + } + + /** {@inheritDoc} */ + @Override + public RateLimitRule withMatchConditions(List matchConditions) { + super.withMatchConditions(matchConditions); + return this; + } + + /** {@inheritDoc} */ + @Override + public RateLimitRule withAction(ActionType action) { + super.withAction(action); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRuleList.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRuleList.java new file mode 100644 index 0000000000000..53f16e8be3cf9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRuleList.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of rate limit rules. */ +@Fluent +public final class RateLimitRuleList { + /* + * List of rules + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of RateLimitRuleList class. */ + public RateLimitRuleList() { + } + + /** + * Get the rules property: List of rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules. + * + * @param rules the rules value to set. + * @return the RateLimitRuleList object itself. + */ + public RateLimitRuleList withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.java new file mode 100644 index 0000000000000..6d65ef62970f8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The redirect type the rule will use when redirecting traffic. */ +public final class RedirectType extends ExpandableStringEnum { + /** Static value Moved for RedirectType. */ + public static final RedirectType MOVED = fromString("Moved"); + + /** Static value Found for RedirectType. */ + public static final RedirectType FOUND = fromString("Found"); + + /** Static value TemporaryRedirect for RedirectType. */ + public static final RedirectType TEMPORARY_REDIRECT = fromString("TemporaryRedirect"); + + /** Static value PermanentRedirect for RedirectType. */ + public static final RedirectType PERMANENT_REDIRECT = fromString("PermanentRedirect"); + + /** + * Creates or finds a RedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedirectType. + */ + @JsonCreator + public static RedirectType fromString(String name) { + return fromString(name, RedirectType.class); + } + + /** + * Gets known RedirectType values. + * + * @return known RedirectType values. + */ + public static Collection values() { + return values(RedirectType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java new file mode 100644 index 0000000000000..d8e25893e005f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RemoteAddress match conditions. */ +@Fluent +public final class RemoteAddressMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRemoteAddressConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private RemoteAddressOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * Match values to match against. The operator will apply to each value in here with OR semantics. If any of them + * match the variable with the given operator this match condition is considered a match. + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of RemoteAddressMatchConditionParameters class. */ + public RemoteAddressMatchConditionParameters() { + typeName = "DeliveryRuleRemoteAddressConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RemoteAddressOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withOperator(RemoteAddressOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: Match values to match against. The operator will apply to each value in here with + * OR semantics. If any of them match the variable with the given operator this match condition is considered a + * match. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: Match values to match against. The operator will apply to each value in here with + * OR semantics. If any of them match the variable with the given operator this match condition is considered a + * match. + * + * @param matchValues the matchValues value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model RemoteAddressMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RemoteAddressMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.java new file mode 100644 index 0000000000000..feb7792034380 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class RemoteAddressOperator extends ExpandableStringEnum { + /** Static value Any for RemoteAddressOperator. */ + public static final RemoteAddressOperator ANY = fromString("Any"); + + /** Static value IPMatch for RemoteAddressOperator. */ + public static final RemoteAddressOperator IPMATCH = fromString("IPMatch"); + + /** Static value GeoMatch for RemoteAddressOperator. */ + public static final RemoteAddressOperator GEO_MATCH = fromString("GeoMatch"); + + /** + * Creates or finds a RemoteAddressOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RemoteAddressOperator. + */ + @JsonCreator + public static RemoteAddressOperator fromString(String name) { + return fromString(name, RemoteAddressOperator.class); + } + + /** + * Gets known RemoteAddressOperator values. + * + * @return known RemoteAddressOperator values. + */ + public static Collection values() { + return values(RemoteAddressOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java new file mode 100644 index 0000000000000..94caa5334c108 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestBody match conditions. */ +@Fluent +public final class RequestBodyMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRequestBodyConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private RequestBodyOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of RequestBodyMatchConditionParameters class. */ + public RequestBodyMatchConditionParameters() { + typeName = "DeliveryRuleRequestBodyConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RequestBodyOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withOperator(RequestBodyOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model RequestBodyMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestBodyMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.java new file mode 100644 index 0000000000000..bc4567ad399d2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class RequestBodyOperator extends ExpandableStringEnum { + /** Static value Any for RequestBodyOperator. */ + public static final RequestBodyOperator ANY = fromString("Any"); + + /** Static value Equal for RequestBodyOperator. */ + public static final RequestBodyOperator EQUAL = fromString("Equal"); + + /** Static value Contains for RequestBodyOperator. */ + public static final RequestBodyOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for RequestBodyOperator. */ + public static final RequestBodyOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for RequestBodyOperator. */ + public static final RequestBodyOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for RequestBodyOperator. */ + public static final RequestBodyOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for RequestBodyOperator. */ + public static final RequestBodyOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for RequestBodyOperator. */ + public static final RequestBodyOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for RequestBodyOperator. */ + public static final RequestBodyOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for RequestBodyOperator. */ + public static final RequestBodyOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a RequestBodyOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestBodyOperator. + */ + @JsonCreator + public static RequestBodyOperator fromString(String name) { + return fromString(name, RequestBodyOperator.class); + } + + /** + * Gets known RequestBodyOperator values. + * + * @return known RequestBodyOperator values. + */ + public static Collection values() { + return values(RequestBodyOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java new file mode 100644 index 0000000000000..4963b55d1eb62 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestHeader match conditions. */ +@Fluent +public final class RequestHeaderMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRequestHeaderConditionParameters"; + + /* + * Name of Header to be matched + */ + @JsonProperty(value = "selector") + private String selector; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private RequestHeaderOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of RequestHeaderMatchConditionParameters class. */ + public RequestHeaderMatchConditionParameters() { + typeName = "DeliveryRuleRequestHeaderConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the selector property: Name of Header to be matched. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: Name of Header to be matched. + * + * @param selector the selector value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RequestHeaderOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withOperator(RequestHeaderOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model RequestHeaderMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestHeaderMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.java new file mode 100644 index 0000000000000..0699be33c2fe9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class RequestHeaderOperator extends ExpandableStringEnum { + /** Static value Any for RequestHeaderOperator. */ + public static final RequestHeaderOperator ANY = fromString("Any"); + + /** Static value Equal for RequestHeaderOperator. */ + public static final RequestHeaderOperator EQUAL = fromString("Equal"); + + /** Static value Contains for RequestHeaderOperator. */ + public static final RequestHeaderOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for RequestHeaderOperator. */ + public static final RequestHeaderOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for RequestHeaderOperator. */ + public static final RequestHeaderOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for RequestHeaderOperator. */ + public static final RequestHeaderOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for RequestHeaderOperator. */ + public static final RequestHeaderOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for RequestHeaderOperator. */ + public static final RequestHeaderOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for RequestHeaderOperator. */ + public static final RequestHeaderOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for RequestHeaderOperator. */ + public static final RequestHeaderOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a RequestHeaderOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestHeaderOperator. + */ + @JsonCreator + public static RequestHeaderOperator fromString(String name) { + return fromString(name, RequestHeaderOperator.class); + } + + /** + * Gets known RequestHeaderOperator values. + * + * @return known RequestHeaderOperator values. + */ + public static Collection values() { + return values(RequestHeaderOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java new file mode 100644 index 0000000000000..6fb113dea6303 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestMethod match conditions. */ +@Fluent +public final class RequestMethodMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRequestMethodConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private RequestMethodOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /** Creates an instance of RequestMethodMatchConditionParameters class. */ + public RequestMethodMatchConditionParameters() { + typeName = "DeliveryRuleRequestMethodConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RequestMethodOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withOperator(RequestMethodOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withMatchValues( + List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model RequestMethodMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestMethodMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParametersMatchValuesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParametersMatchValuesItem.java new file mode 100644 index 0000000000000..0fce1c32bd48f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParametersMatchValuesItem.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestMethodMatchConditionParametersMatchValuesItem. */ +public final class RequestMethodMatchConditionParametersMatchValuesItem + extends ExpandableStringEnum { + /** Static value GET for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem GET = fromString("GET"); + + /** Static value HEAD for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem HEAD = fromString("HEAD"); + + /** Static value POST for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem POST = fromString("POST"); + + /** Static value PUT for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem PUT = fromString("PUT"); + + /** Static value DELETE for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem DELETE = fromString("DELETE"); + + /** Static value OPTIONS for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem OPTIONS = fromString("OPTIONS"); + + /** Static value TRACE for RequestMethodMatchConditionParametersMatchValuesItem. */ + public static final RequestMethodMatchConditionParametersMatchValuesItem TRACE = fromString("TRACE"); + + /** + * Creates or finds a RequestMethodMatchConditionParametersMatchValuesItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestMethodMatchConditionParametersMatchValuesItem. + */ + @JsonCreator + public static RequestMethodMatchConditionParametersMatchValuesItem fromString(String name) { + return fromString(name, RequestMethodMatchConditionParametersMatchValuesItem.class); + } + + /** + * Gets known RequestMethodMatchConditionParametersMatchValuesItem values. + * + * @return known RequestMethodMatchConditionParametersMatchValuesItem values. + */ + public static Collection values() { + return values(RequestMethodMatchConditionParametersMatchValuesItem.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.java new file mode 100644 index 0000000000000..101dd212d2947 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class RequestMethodOperator extends ExpandableStringEnum { + /** Static value Equal for RequestMethodOperator. */ + public static final RequestMethodOperator EQUAL = fromString("Equal"); + + /** + * Creates or finds a RequestMethodOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestMethodOperator. + */ + @JsonCreator + public static RequestMethodOperator fromString(String name) { + return fromString(name, RequestMethodOperator.class); + } + + /** + * Gets known RequestMethodOperator values. + * + * @return known RequestMethodOperator values. + */ + public static Collection values() { + return values(RequestMethodOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java new file mode 100644 index 0000000000000..8e207beb232af --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestScheme match conditions. */ +@Fluent +public final class RequestSchemeMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRequestSchemeConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private String operator = "Equal"; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /** Creates an instance of RequestSchemeMatchConditionParameters class. */ + public RequestSchemeMatchConditionParameters() { + typeName = "DeliveryRuleRequestSchemeConditionParameters"; + operator = "Equal"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public String operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withOperator(String operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withMatchValues( + List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParametersMatchValuesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParametersMatchValuesItem.java new file mode 100644 index 0000000000000..cf887b1383610 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParametersMatchValuesItem.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestSchemeMatchConditionParametersMatchValuesItem. */ +public final class RequestSchemeMatchConditionParametersMatchValuesItem + extends ExpandableStringEnum { + /** Static value HTTP for RequestSchemeMatchConditionParametersMatchValuesItem. */ + public static final RequestSchemeMatchConditionParametersMatchValuesItem HTTP = fromString("HTTP"); + + /** Static value HTTPS for RequestSchemeMatchConditionParametersMatchValuesItem. */ + public static final RequestSchemeMatchConditionParametersMatchValuesItem HTTPS = fromString("HTTPS"); + + /** + * Creates or finds a RequestSchemeMatchConditionParametersMatchValuesItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestSchemeMatchConditionParametersMatchValuesItem. + */ + @JsonCreator + public static RequestSchemeMatchConditionParametersMatchValuesItem fromString(String name) { + return fromString(name, RequestSchemeMatchConditionParametersMatchValuesItem.class); + } + + /** + * Gets known RequestSchemeMatchConditionParametersMatchValuesItem values. + * + * @return known RequestSchemeMatchConditionParametersMatchValuesItem values. + */ + public static Collection values() { + return values(RequestSchemeMatchConditionParametersMatchValuesItem.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.java new file mode 100644 index 0000000000000..d6f1e73788698 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestUri match conditions. */ +@Fluent +public final class RequestUriMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRequestUriConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private RequestUriOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of RequestUriMatchConditionParameters class. */ + public RequestUriMatchConditionParameters() { + typeName = "DeliveryRuleRequestUriConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public RequestUriOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withOperator(RequestUriOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model RequestUriMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RequestUriMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.java new file mode 100644 index 0000000000000..48a0cdc6ed8a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class RequestUriOperator extends ExpandableStringEnum { + /** Static value Any for RequestUriOperator. */ + public static final RequestUriOperator ANY = fromString("Any"); + + /** Static value Equal for RequestUriOperator. */ + public static final RequestUriOperator EQUAL = fromString("Equal"); + + /** Static value Contains for RequestUriOperator. */ + public static final RequestUriOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for RequestUriOperator. */ + public static final RequestUriOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for RequestUriOperator. */ + public static final RequestUriOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for RequestUriOperator. */ + public static final RequestUriOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for RequestUriOperator. */ + public static final RequestUriOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for RequestUriOperator. */ + public static final RequestUriOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for RequestUriOperator. */ + public static final RequestUriOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for RequestUriOperator. */ + public static final RequestUriOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a RequestUriOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestUriOperator. + */ + @JsonCreator + public static RequestUriOperator fromString(String name) { + return fromString(name, RequestUriOperator.class); + } + + /** + * Gets known RequestUriOperator values. + * + * @return known RequestUriOperator values. + */ + public static Collection values() { + return values(RequestUriOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java new file mode 100644 index 0000000000000..0f64074320da4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + Response checkEndpointNameAvailabilityWithResponse( + String resourceGroupName, + CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput, + Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * afdx endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param checkEndpointNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckEndpointNameAvailabilityOutput checkEndpointNameAvailability( + String resourceGroupName, CheckEndpointNameAvailabilityInput checkEndpointNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @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 output of check name availability API along with {@link Response}. + */ + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This is needed for resources where name is globally unique, such as a + * CDN endpoint. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check name availability API. + */ + CheckNameAvailabilityOutput checkNameAvailabilityWithSubscription( + CheckNameAvailabilityInput checkNameAvailabilityInput); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @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 output of the validate probe API along with {@link Response}. + */ + Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, Context context); + + /** + * Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on + * the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative + * to the origin path specified in the endpoint configuration. + * + * @param validateProbeInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of the validate probe API. + */ + ValidateProbeOutput validateProbe(ValidateProbeInput validateProbeInput); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java new file mode 100644 index 0000000000000..639fe271a94e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to another resource. */ +@Fluent +public final class ResourceReference { + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ResourceReference class. */ + public ResourceReference() { + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ResourceReference object itself. + */ + public ResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.java new file mode 100644 index 0000000000000..0270831367657 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceType.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of CDN resource used in CheckNameAvailability. */ +public final class ResourceType extends ExpandableStringEnum { + /** Static value Microsoft.Cdn/Profiles/Endpoints for ResourceType. */ + public static final ResourceType MICROSOFT_CDN_PROFILES_ENDPOINTS = fromString("Microsoft.Cdn/Profiles/Endpoints"); + + /** Static value Microsoft.Cdn/Profiles/AfdEndpoints for ResourceType. */ + public static final ResourceType MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS = + fromString("Microsoft.Cdn/Profiles/AfdEndpoints"); + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + @JsonCreator + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java new file mode 100644 index 0000000000000..d90f5c48af6ea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; + +/** An immutable client-side representation of ResourceUsage. */ +public interface ResourceUsage { + /** + * Gets the resourceType property: Resource type for which the usage is provided. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the unit property: Unit of the usage. e.g. count. + * + * @return the unit value. + */ + ResourceUsageUnit unit(); + + /** + * Gets the currentValue property: Actual value of usage on the specified resource type. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: Quota of the specified resource type. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner object. + * + * @return the inner object. + */ + ResourceUsageInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.java new file mode 100644 index 0000000000000..e49ecec8b4e41 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output of check resource usage API. */ +@Fluent +public final class ResourceUsageListResult { + /* + * List of resource usages. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of custom domain objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ResourceUsageListResult class. */ + public ResourceUsageListResult() { + } + + /** + * Get the value property: List of resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of custom domain objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ResourceUsageListResult object itself. + */ + public ResourceUsageListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.java new file mode 100644 index 0000000000000..0292c8b5a65b3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageUnit.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Unit of the usage. e.g. count. */ +public final class ResourceUsageUnit extends ExpandableStringEnum { + /** Static value count for ResourceUsageUnit. */ + public static final ResourceUsageUnit COUNT = fromString("count"); + + /** + * Creates or finds a ResourceUsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceUsageUnit. + */ + @JsonCreator + public static ResourceUsageUnit fromString(String name) { + return fromString(name, ResourceUsageUnit.class); + } + + /** + * Gets known ResourceUsageUnit values. + * + * @return known ResourceUsageUnit values. + */ + public static Collection values() { + return values(ResourceUsageUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java new file mode 100644 index 0000000000000..f8a93bc0616a8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceUsages. */ +public interface ResourceUsages { + /** + * Check the quota and actual usage of the CDN profiles under the given 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 output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Check the quota and actual usage of the CDN profiles under the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of check resource usage API as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java new file mode 100644 index 0000000000000..a4e9aa0e390dc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner; +import java.util.List; + +/** An immutable client-side representation of ResourcesResponse. */ +public interface ResourcesResponse { + /** + * Gets the endpoints property: The endpoints property. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the customDomains property: The customDomains property. + * + * @return the customDomains value. + */ + List customDomains(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ResourcesResponseInner object. + * + * @return the inner object. + */ + ResourcesResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseCustomDomainsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseCustomDomainsItem.java new file mode 100644 index 0000000000000..ea55d8d7d05bc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseCustomDomainsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourcesResponseCustomDomainsItem model. */ +@Fluent +public final class ResourcesResponseCustomDomainsItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The endpointId property. + */ + @JsonProperty(value = "endpointId") + private String endpointId; + + /* + * The history property. + */ + @JsonProperty(value = "history") + private Boolean history; + + /** Creates an instance of ResourcesResponseCustomDomainsItem class. */ + public ResourcesResponseCustomDomainsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpointId property: The endpointId property. + * + * @return the endpointId value. + */ + public String endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId property: The endpointId property. + * + * @param endpointId the endpointId value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withEndpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseCustomDomainsItem object itself. + */ + public ResourcesResponseCustomDomainsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsItem.java new file mode 100644 index 0000000000000..55575a307b075 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsItem.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourcesResponseEndpointsItem model. */ +@Fluent +public final class ResourcesResponseEndpointsItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The history property. + */ + @JsonProperty(value = "history") + private Boolean history; + + /* + * The customDomains property. + */ + @JsonProperty(value = "customDomains") + private List customDomains; + + /** Creates an instance of ResourcesResponseEndpointsItem class. */ + public ResourcesResponseEndpointsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Get the customDomains property: The customDomains property. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: The customDomains property. + * + * @param customDomains the customDomains value to set. + * @return the ResourcesResponseEndpointsItem object itself. + */ + public ResourcesResponseEndpointsItem withCustomDomains( + List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomains() != null) { + customDomains().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.java new file mode 100644 index 0000000000000..96ad89a1b7517 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourcesResponseEndpointsPropertiesItemsItem model. */ +@Fluent +public final class ResourcesResponseEndpointsPropertiesItemsItem { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The endpointId property. + */ + @JsonProperty(value = "endpointId") + private String endpointId; + + /* + * The history property. + */ + @JsonProperty(value = "history") + private Boolean history; + + /** Creates an instance of ResourcesResponseEndpointsPropertiesItemsItem class. */ + public ResourcesResponseEndpointsPropertiesItemsItem() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpointId property: The endpointId property. + * + * @return the endpointId value. + */ + public String endpointId() { + return this.endpointId; + } + + /** + * Set the endpointId property: The endpointId property. + * + * @param endpointId the endpointId value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withEndpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * Get the history property: The history property. + * + * @return the history value. + */ + public Boolean history() { + return this.history; + } + + /** + * Set the history property: The history property. + * + * @param history the history value to set. + * @return the ResourcesResponseEndpointsPropertiesItemsItem object itself. + */ + public ResourcesResponseEndpointsPropertiesItemsItem withHistory(Boolean history) { + this.history = history; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.java new file mode 100644 index 0000000000000..2f403443b7be9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.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.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Type of response errors for real user requests for which origin will be deemed unhealthy. */ +public enum ResponseBasedDetectedErrorTypes { + /** Enum value None. */ + NONE("None"), + + /** Enum value TcpErrorsOnly. */ + TCP_ERRORS_ONLY("TcpErrorsOnly"), + + /** Enum value TcpAndHttpErrors. */ + TCP_AND_HTTP_ERRORS("TcpAndHttpErrors"); + + /** The actual serialized value for a ResponseBasedDetectedErrorTypes instance. */ + private final String value; + + ResponseBasedDetectedErrorTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResponseBasedDetectedErrorTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ResponseBasedDetectedErrorTypes object, or null if unable to parse. + */ + @JsonCreator + public static ResponseBasedDetectedErrorTypes fromString(String value) { + if (value == null) { + return null; + } + ResponseBasedDetectedErrorTypes[] items = ResponseBasedDetectedErrorTypes.values(); + for (ResponseBasedDetectedErrorTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.java new file mode 100644 index 0000000000000..3b1aaca094d9e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties to determine origin health using real requests/responses. */ +@Fluent +public final class ResponseBasedOriginErrorDetectionParameters { + /* + * Type of response errors for real user requests for which origin will be deemed unhealthy + */ + @JsonProperty(value = "responseBasedDetectedErrorTypes") + private ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes; + + /* + * The percentage of failed requests in the sample where failover should trigger. + */ + @JsonProperty(value = "responseBasedFailoverThresholdPercentage") + private Integer responseBasedFailoverThresholdPercentage; + + /* + * The list of Http status code ranges that are considered as server errors for origin and it is marked as + * unhealthy. + */ + @JsonProperty(value = "httpErrorRanges") + private List httpErrorRanges; + + /** Creates an instance of ResponseBasedOriginErrorDetectionParameters class. */ + public ResponseBasedOriginErrorDetectionParameters() { + } + + /** + * Get the responseBasedDetectedErrorTypes property: Type of response errors for real user requests for which origin + * will be deemed unhealthy. + * + * @return the responseBasedDetectedErrorTypes value. + */ + public ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes() { + return this.responseBasedDetectedErrorTypes; + } + + /** + * Set the responseBasedDetectedErrorTypes property: Type of response errors for real user requests for which origin + * will be deemed unhealthy. + * + * @param responseBasedDetectedErrorTypes the responseBasedDetectedErrorTypes value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters withResponseBasedDetectedErrorTypes( + ResponseBasedDetectedErrorTypes responseBasedDetectedErrorTypes) { + this.responseBasedDetectedErrorTypes = responseBasedDetectedErrorTypes; + return this; + } + + /** + * Get the responseBasedFailoverThresholdPercentage property: The percentage of failed requests in the sample where + * failover should trigger. + * + * @return the responseBasedFailoverThresholdPercentage value. + */ + public Integer responseBasedFailoverThresholdPercentage() { + return this.responseBasedFailoverThresholdPercentage; + } + + /** + * Set the responseBasedFailoverThresholdPercentage property: The percentage of failed requests in the sample where + * failover should trigger. + * + * @param responseBasedFailoverThresholdPercentage the responseBasedFailoverThresholdPercentage value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters withResponseBasedFailoverThresholdPercentage( + Integer responseBasedFailoverThresholdPercentage) { + this.responseBasedFailoverThresholdPercentage = responseBasedFailoverThresholdPercentage; + return this; + } + + /** + * Get the httpErrorRanges property: The list of Http status code ranges that are considered as server errors for + * origin and it is marked as unhealthy. + * + * @return the httpErrorRanges value. + */ + public List httpErrorRanges() { + return this.httpErrorRanges; + } + + /** + * Set the httpErrorRanges property: The list of Http status code ranges that are considered as server errors for + * origin and it is marked as unhealthy. + * + * @param httpErrorRanges the httpErrorRanges value to set. + * @return the ResponseBasedOriginErrorDetectionParameters object itself. + */ + public ResponseBasedOriginErrorDetectionParameters withHttpErrorRanges( + List httpErrorRanges) { + this.httpErrorRanges = httpErrorRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpErrorRanges() != null) { + httpErrorRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.java new file mode 100644 index 0000000000000..67ad2f8625153 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.java @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import java.util.List; + +/** An immutable client-side representation of Route. */ +public interface Route { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + String endpointName(); + + /** + * Gets the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + List customDomains(); + + /** + * Gets the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + ResourceReference originGroup(); + + /** + * Gets the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + String originPath(); + + /** + * Gets the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + List ruleSets(); + + /** + * Gets the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + List supportedProtocols(); + + /** + * Gets the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + List patternsToMatch(); + + /** + * Gets the cacheConfiguration property: The caching configuration for this route. To disable caching, do not + * provide a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + AfdRouteCacheConfiguration cacheConfiguration(); + + /** + * Gets the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + ForwardingProtocol forwardingProtocol(); + + /** + * Gets the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + LinkToDefaultDomain linkToDefaultDomain(); + + /** + * Gets the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + HttpsRedirect httpsRedirect(); + + /** + * Gets the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner object. + * + * @return the inner object. + */ + RouteInner innerModel(); + + /** The entirety of the Route definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Route definition stages. */ + interface DefinitionStages { + /** The first stage of the Route definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Route definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, endpointName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @return the next definition stage. + */ + WithCreate withExistingAfdEndpoint(String resourceGroupName, String profileName, String endpointName); + } + /** + * The stage of the Route 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.WithCustomDomains, + DefinitionStages.WithOriginGroup, + DefinitionStages.WithOriginPath, + DefinitionStages.WithRuleSets, + DefinitionStages.WithSupportedProtocols, + DefinitionStages.WithPatternsToMatch, + DefinitionStages.WithCacheConfiguration, + DefinitionStages.WithForwardingProtocol, + DefinitionStages.WithLinkToDefaultDomain, + DefinitionStages.WithHttpsRedirect, + DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route create(Context context); + } + /** The stage of the Route definition allowing to specify customDomains. */ + interface WithCustomDomains { + /** + * Specifies the customDomains property: Domains referenced by this endpoint.. + * + * @param customDomains Domains referenced by this endpoint. + * @return the next definition stage. + */ + WithCreate withCustomDomains(List customDomains); + } + /** The stage of the Route definition allowing to specify originGroup. */ + interface WithOriginGroup { + /** + * Specifies the originGroup property: A reference to the origin group.. + * + * @param originGroup A reference to the origin group. + * @return the next definition stage. + */ + WithCreate withOriginGroup(ResourceReference originGroup); + } + /** The stage of the Route definition allowing to specify originPath. */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve + * content from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + WithCreate withOriginPath(String originPath); + } + /** The stage of the Route definition allowing to specify ruleSets. */ + interface WithRuleSets { + /** + * Specifies the ruleSets property: rule sets referenced by this endpoint.. + * + * @param ruleSets rule sets referenced by this endpoint. + * @return the next definition stage. + */ + WithCreate withRuleSets(List ruleSets); + } + /** The stage of the Route definition allowing to specify supportedProtocols. */ + interface WithSupportedProtocols { + /** + * Specifies the supportedProtocols property: List of supported protocols for this route.. + * + * @param supportedProtocols List of supported protocols for this route. + * @return the next definition stage. + */ + WithCreate withSupportedProtocols(List supportedProtocols); + } + /** The stage of the Route definition allowing to specify patternsToMatch. */ + interface WithPatternsToMatch { + /** + * Specifies the patternsToMatch property: The route patterns of the rule.. + * + * @param patternsToMatch The route patterns of the rule. + * @return the next definition stage. + */ + WithCreate withPatternsToMatch(List patternsToMatch); + } + /** The stage of the Route definition allowing to specify cacheConfiguration. */ + interface WithCacheConfiguration { + /** + * Specifies the cacheConfiguration property: The caching configuration for this route. To disable caching, + * do not provide a cacheConfiguration object.. + * + * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a + * cacheConfiguration object. + * @return the next definition stage. + */ + WithCreate withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration); + } + /** The stage of the Route definition allowing to specify forwardingProtocol. */ + interface WithForwardingProtocol { + /** + * Specifies the forwardingProtocol property: Protocol this rule will use when forwarding traffic to + * backends.. + * + * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends. + * @return the next definition stage. + */ + WithCreate withForwardingProtocol(ForwardingProtocol forwardingProtocol); + } + /** The stage of the Route definition allowing to specify linkToDefaultDomain. */ + interface WithLinkToDefaultDomain { + /** + * Specifies the linkToDefaultDomain property: whether this route will be linked to the default endpoint + * domain.. + * + * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain. + * @return the next definition stage. + */ + WithCreate withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain); + } + /** The stage of the Route definition allowing to specify httpsRedirect. */ + interface WithHttpsRedirect { + /** + * Specifies the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. + * Note that this is a easy way to set up this rule and it will be the first rule that gets executed.. + * + * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a + * easy way to set up this rule and it will be the first rule that gets executed. + * @return the next definition stage. + */ + WithCreate withHttpsRedirect(HttpsRedirect httpsRedirect); + } + /** The stage of the Route definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnabledState enabledState); + } + } + /** + * Begins update for the Route resource. + * + * @return the stage of resource update. + */ + Route.Update update(); + + /** The template for Route update. */ + interface Update + extends UpdateStages.WithCustomDomains, + UpdateStages.WithOriginGroup, + UpdateStages.WithOriginPath, + UpdateStages.WithRuleSets, + UpdateStages.WithSupportedProtocols, + UpdateStages.WithPatternsToMatch, + UpdateStages.WithCacheConfiguration, + UpdateStages.WithForwardingProtocol, + UpdateStages.WithLinkToDefaultDomain, + UpdateStages.WithHttpsRedirect, + UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route apply(Context context); + } + /** The Route update stages. */ + interface UpdateStages { + /** The stage of the Route update allowing to specify customDomains. */ + interface WithCustomDomains { + /** + * Specifies the customDomains property: Domains referenced by this endpoint.. + * + * @param customDomains Domains referenced by this endpoint. + * @return the next definition stage. + */ + Update withCustomDomains(List customDomains); + } + /** The stage of the Route update allowing to specify originGroup. */ + interface WithOriginGroup { + /** + * Specifies the originGroup property: A reference to the origin group.. + * + * @param originGroup A reference to the origin group. + * @return the next definition stage. + */ + Update withOriginGroup(ResourceReference originGroup); + } + /** The stage of the Route update allowing to specify originPath. */ + interface WithOriginPath { + /** + * Specifies the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve + * content from, e.g. contoso.cloudapp.net/originpath.. + * + * @param originPath A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * @return the next definition stage. + */ + Update withOriginPath(String originPath); + } + /** The stage of the Route update allowing to specify ruleSets. */ + interface WithRuleSets { + /** + * Specifies the ruleSets property: rule sets referenced by this endpoint.. + * + * @param ruleSets rule sets referenced by this endpoint. + * @return the next definition stage. + */ + Update withRuleSets(List ruleSets); + } + /** The stage of the Route update allowing to specify supportedProtocols. */ + interface WithSupportedProtocols { + /** + * Specifies the supportedProtocols property: List of supported protocols for this route.. + * + * @param supportedProtocols List of supported protocols for this route. + * @return the next definition stage. + */ + Update withSupportedProtocols(List supportedProtocols); + } + /** The stage of the Route update allowing to specify patternsToMatch. */ + interface WithPatternsToMatch { + /** + * Specifies the patternsToMatch property: The route patterns of the rule.. + * + * @param patternsToMatch The route patterns of the rule. + * @return the next definition stage. + */ + Update withPatternsToMatch(List patternsToMatch); + } + /** The stage of the Route update allowing to specify cacheConfiguration. */ + interface WithCacheConfiguration { + /** + * Specifies the cacheConfiguration property: The caching configuration for this route. To disable caching, + * do not provide a cacheConfiguration object.. + * + * @param cacheConfiguration The caching configuration for this route. To disable caching, do not provide a + * cacheConfiguration object. + * @return the next definition stage. + */ + Update withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration); + } + /** The stage of the Route update allowing to specify forwardingProtocol. */ + interface WithForwardingProtocol { + /** + * Specifies the forwardingProtocol property: Protocol this rule will use when forwarding traffic to + * backends.. + * + * @param forwardingProtocol Protocol this rule will use when forwarding traffic to backends. + * @return the next definition stage. + */ + Update withForwardingProtocol(ForwardingProtocol forwardingProtocol); + } + /** The stage of the Route update allowing to specify linkToDefaultDomain. */ + interface WithLinkToDefaultDomain { + /** + * Specifies the linkToDefaultDomain property: whether this route will be linked to the default endpoint + * domain.. + * + * @param linkToDefaultDomain whether this route will be linked to the default endpoint domain. + * @return the next definition stage. + */ + Update withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain); + } + /** The stage of the Route update allowing to specify httpsRedirect. */ + interface WithHttpsRedirect { + /** + * Specifies the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. + * Note that this is a easy way to set up this rule and it will be the first rule that gets executed.. + * + * @param httpsRedirect Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a + * easy way to set up this rule and it will be the first rule that gets executed. + * @return the next definition stage. + */ + Update withHttpsRedirect(HttpsRedirect httpsRedirect); + } + /** The stage of the Route update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' + * or 'Disabled'. + * + * @param enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withEnabledState(EnabledState enabledState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.java new file mode 100644 index 0000000000000..27edb9c5ab18d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteConfigurationOverrideActionParameters.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the route configuration override action. */ +@Fluent +public final class RouteConfigurationOverrideActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleRouteConfigurationOverrideActionParameters"; + + /* + * A reference to the origin group override configuration. Leave empty to use the default origin group on route. + */ + @JsonProperty(value = "originGroupOverride") + private OriginGroupOverride originGroupOverride; + + /* + * The caching configuration associated with this rule. To disable caching, do not provide a cacheConfiguration + * object. + */ + @JsonProperty(value = "cacheConfiguration") + private CacheConfiguration cacheConfiguration; + + /** Creates an instance of RouteConfigurationOverrideActionParameters class. */ + public RouteConfigurationOverrideActionParameters() { + typeName = "DeliveryRuleRouteConfigurationOverrideActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the RouteConfigurationOverrideActionParameters object itself. + */ + public RouteConfigurationOverrideActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the originGroupOverride property: A reference to the origin group override configuration. Leave empty to use + * the default origin group on route. + * + * @return the originGroupOverride value. + */ + public OriginGroupOverride originGroupOverride() { + return this.originGroupOverride; + } + + /** + * Set the originGroupOverride property: A reference to the origin group override configuration. Leave empty to use + * the default origin group on route. + * + * @param originGroupOverride the originGroupOverride value to set. + * @return the RouteConfigurationOverrideActionParameters object itself. + */ + public RouteConfigurationOverrideActionParameters withOriginGroupOverride(OriginGroupOverride originGroupOverride) { + this.originGroupOverride = originGroupOverride; + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration associated with this rule. To disable caching, do + * not provide a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public CacheConfiguration cacheConfiguration() { + return this.cacheConfiguration; + } + + /** + * Set the cacheConfiguration property: The caching configuration associated with this rule. To disable caching, do + * not provide a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteConfigurationOverrideActionParameters object itself. + */ + public RouteConfigurationOverrideActionParameters withCacheConfiguration(CacheConfiguration cacheConfiguration) { + this.cacheConfiguration = cacheConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (originGroupOverride() != null) { + originGroupOverride().validate(); + } + if (cacheConfiguration() != null) { + cacheConfiguration().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteListResult.java new file mode 100644 index 0000000000000..837be86b4489a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list routes. It contains a list of route objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class RouteListResult { + /* + * List of AzureFrontDoor routes within a profile. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of route objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RouteListResult class. */ + public RouteListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor routes within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of route objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of route objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.java new file mode 100644 index 0000000000000..b47902fb0135e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The domain JSON object required for domain creation or update. */ +@Fluent +public final class RouteUpdateParameters { + /* + * The JSON object that contains the properties of the domain to create. + */ + @JsonProperty(value = "properties") + private RouteUpdatePropertiesParameters innerProperties; + + /** Creates an instance of RouteUpdateParameters class. */ + public RouteUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the domain to create. + * + * @return the innerProperties value. + */ + private RouteUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the endpointName property: The name of the endpoint which holds the route. + * + * @return the endpointName value. + */ + public String endpointName() { + return this.innerProperties() == null ? null : this.innerProperties().endpointName(); + } + + /** + * Get the customDomains property: Domains referenced by this endpoint. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.innerProperties() == null ? null : this.innerProperties().customDomains(); + } + + /** + * Set the customDomains property: Domains referenced by this endpoint. + * + * @param customDomains the customDomains value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withCustomDomains(List customDomains) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withCustomDomains(customDomains); + return this; + } + + /** + * Get the originGroup property: A reference to the origin group. + * + * @return the originGroup value. + */ + public ResourceReference originGroup() { + return this.innerProperties() == null ? null : this.innerProperties().originGroup(); + } + + /** + * Set the originGroup property: A reference to the origin group. + * + * @param originGroup the originGroup value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withOriginGroup(ResourceReference originGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withOriginGroup(originGroup); + return this; + } + + /** + * Get the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @return the originPath value. + */ + public String originPath() { + return this.innerProperties() == null ? null : this.innerProperties().originPath(); + } + + /** + * Set the originPath property: A directory path on the origin that AzureFrontDoor can use to retrieve content from, + * e.g. contoso.cloudapp.net/originpath. + * + * @param originPath the originPath value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withOriginPath(String originPath) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withOriginPath(originPath); + return this; + } + + /** + * Get the ruleSets property: rule sets referenced by this endpoint. + * + * @return the ruleSets value. + */ + public List ruleSets() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSets(); + } + + /** + * Set the ruleSets property: rule sets referenced by this endpoint. + * + * @param ruleSets the ruleSets value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withRuleSets(List ruleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withRuleSets(ruleSets); + return this; + } + + /** + * Get the supportedProtocols property: List of supported protocols for this route. + * + * @return the supportedProtocols value. + */ + public List supportedProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().supportedProtocols(); + } + + /** + * Set the supportedProtocols property: List of supported protocols for this route. + * + * @param supportedProtocols the supportedProtocols value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withSupportedProtocols(List supportedProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withSupportedProtocols(supportedProtocols); + return this; + } + + /** + * Get the patternsToMatch property: The route patterns of the rule. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.innerProperties() == null ? null : this.innerProperties().patternsToMatch(); + } + + /** + * Set the patternsToMatch property: The route patterns of the rule. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withPatternsToMatch(List patternsToMatch) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withPatternsToMatch(patternsToMatch); + return this; + } + + /** + * Get the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @return the cacheConfiguration value. + */ + public AfdRouteCacheConfiguration cacheConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().cacheConfiguration(); + } + + /** + * Set the cacheConfiguration property: The caching configuration for this route. To disable caching, do not provide + * a cacheConfiguration object. + * + * @param cacheConfiguration the cacheConfiguration value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withCacheConfiguration(AfdRouteCacheConfiguration cacheConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withCacheConfiguration(cacheConfiguration); + return this; + } + + /** + * Get the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @return the forwardingProtocol value. + */ + public ForwardingProtocol forwardingProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().forwardingProtocol(); + } + + /** + * Set the forwardingProtocol property: Protocol this rule will use when forwarding traffic to backends. + * + * @param forwardingProtocol the forwardingProtocol value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withForwardingProtocol(ForwardingProtocol forwardingProtocol) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withForwardingProtocol(forwardingProtocol); + return this; + } + + /** + * Get the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @return the linkToDefaultDomain value. + */ + public LinkToDefaultDomain linkToDefaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().linkToDefaultDomain(); + } + + /** + * Set the linkToDefaultDomain property: whether this route will be linked to the default endpoint domain. + * + * @param linkToDefaultDomain the linkToDefaultDomain value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withLinkToDefaultDomain(LinkToDefaultDomain linkToDefaultDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withLinkToDefaultDomain(linkToDefaultDomain); + return this; + } + + /** + * Get the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @return the httpsRedirect value. + */ + public HttpsRedirect httpsRedirect() { + return this.innerProperties() == null ? null : this.innerProperties().httpsRedirect(); + } + + /** + * Set the httpsRedirect property: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this + * is a easy way to set up this rule and it will be the first rule that gets executed. + * + * @param httpsRedirect the httpsRedirect value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withHttpsRedirect(HttpsRedirect httpsRedirect) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withHttpsRedirect(httpsRedirect); + return this; + } + + /** + * Get the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + public EnabledState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @param enabledState the enabledState value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withEnabledState(EnabledState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteUpdatePropertiesParameters(); + } + this.innerProperties().withEnabledState(enabledState); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.java new file mode 100644 index 0000000000000..dcefa8e42287d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Routes. */ +public interface Routes { + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint(String resourceGroupName, String profileName, String endpointName); + + /** + * Lists all of the existing origins within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list routes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpoint( + String resourceGroupName, String profileName, String endpointName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @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 an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String routeName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + */ + Route get(String resourceGroupName, String profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String endpointName, String routeName); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param routeName Name of the routing rule. + * @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 profileName, String endpointName, String routeName, Context context); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @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 an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Route getById(String id); + + /** + * Gets an existing route with the specified route name under the specified subscription, resource group, profile, + * and AzureFrontDoor endpoint. + * + * @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 an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @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 an existing route with the specified route name under the specified subscription, resource group, + * profile, and AzureFrontDoor endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Route resource. + * + * @param name resource name. + * @return the first stage of the new Route definition. + */ + Route.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java new file mode 100644 index 0000000000000..75d3990cd4777 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import java.util.List; + +/** An immutable client-side representation of Rule. */ +public interface Rule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + String ruleSetName(); + + /** + * Gets the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 + * is a special rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + Integer order(); + + /** + * Gets the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + List conditions(); + + /** + * Gets the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + MatchProcessingBehavior matchProcessingBehavior(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner object. + * + * @return the inner object. + */ + RuleInner innerModel(); + + /** The entirety of the Rule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Rule definition stages. */ + interface DefinitionStages { + /** The first stage of the Rule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Rule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName, ruleSetName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @return the next definition stage. + */ + WithCreate withExistingRuleSet(String resourceGroupName, String profileName, String ruleSetName); + } + /** + * The stage of the Rule 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.WithOrder, + DefinitionStages.WithConditions, + DefinitionStages.WithActions, + DefinitionStages.WithMatchProcessingBehavior { + /** + * Executes the create request. + * + * @return the created resource. + */ + Rule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Rule create(Context context); + } + /** The stage of the Rule definition allowing to specify order. */ + interface WithOrder { + /** + * Specifies the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with + * order 0 is a special rule. It does not require any condition and actions listed in it will always be + * applied.. + * + * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A + * rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a + * special rule. It does not require any condition and actions listed in it will always be applied. + * @return the next definition stage. + */ + WithCreate withOrder(Integer order); + } + /** The stage of the Rule definition allowing to specify conditions. */ + interface WithConditions { + /** + * Specifies the conditions property: A list of conditions that must be matched for the actions to be + * executed. + * + * @param conditions A list of conditions that must be matched for the actions to be executed. + * @return the next definition stage. + */ + WithCreate withConditions(List conditions); + } + /** The stage of the Rule definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: A list of actions that are executed when all the conditions of a rule are + * satisfied.. + * + * @param actions A list of actions that are executed when all the conditions of a rule are satisfied. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + /** The stage of the Rule definition allowing to specify matchProcessingBehavior. */ + interface WithMatchProcessingBehavior { + /** + * Specifies the matchProcessingBehavior property: If this rule is a match should the rules engine continue + * running the remaining rules or stop. If not present, defaults to Continue.. + * + * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * @return the next definition stage. + */ + WithCreate withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior); + } + } + /** + * Begins update for the Rule resource. + * + * @return the stage of resource update. + */ + Rule.Update update(); + + /** The template for Rule update. */ + interface Update + extends UpdateStages.WithOrder, + UpdateStages.WithConditions, + UpdateStages.WithActions, + UpdateStages.WithMatchProcessingBehavior { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Rule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Rule apply(Context context); + } + /** The Rule update stages. */ + interface UpdateStages { + /** The stage of the Rule update allowing to specify order. */ + interface WithOrder { + /** + * Specifies the order property: The order in which the rules are applied for the endpoint. Possible values + * {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with + * order 0 is a special rule. It does not require any condition and actions listed in it will always be + * applied.. + * + * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A + * rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a + * special rule. It does not require any condition and actions listed in it will always be applied. + * @return the next definition stage. + */ + Update withOrder(Integer order); + } + /** The stage of the Rule update allowing to specify conditions. */ + interface WithConditions { + /** + * Specifies the conditions property: A list of conditions that must be matched for the actions to be + * executed. + * + * @param conditions A list of conditions that must be matched for the actions to be executed. + * @return the next definition stage. + */ + Update withConditions(List conditions); + } + /** The stage of the Rule update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: A list of actions that are executed when all the conditions of a rule are + * satisfied.. + * + * @param actions A list of actions that are executed when all the conditions of a rule are satisfied. + * @return the next definition stage. + */ + Update withActions(List actions); + } + /** The stage of the Rule update allowing to specify matchProcessingBehavior. */ + interface WithMatchProcessingBehavior { + /** + * Specifies the matchProcessingBehavior property: If this rule is a match should the rules engine continue + * running the remaining rules or stop. If not present, defaults to Continue.. + * + * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * @return the next definition stage. + */ + Update withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Rule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Rule refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.java new file mode 100644 index 0000000000000..9457db13af442 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleCacheBehavior.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Caching behavior for the requests. */ +public final class RuleCacheBehavior extends ExpandableStringEnum { + /** Static value HonorOrigin for RuleCacheBehavior. */ + public static final RuleCacheBehavior HONOR_ORIGIN = fromString("HonorOrigin"); + + /** Static value OverrideAlways for RuleCacheBehavior. */ + public static final RuleCacheBehavior OVERRIDE_ALWAYS = fromString("OverrideAlways"); + + /** Static value OverrideIfOriginMissing for RuleCacheBehavior. */ + public static final RuleCacheBehavior OVERRIDE_IF_ORIGIN_MISSING = fromString("OverrideIfOriginMissing"); + + /** + * Creates or finds a RuleCacheBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCacheBehavior. + */ + @JsonCreator + public static RuleCacheBehavior fromString(String name) { + return fromString(name, RuleCacheBehavior.class); + } + + /** + * Gets known RuleCacheBehavior values. + * + * @return known RuleCacheBehavior values. + */ + public static Collection values() { + return values(RuleCacheBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java new file mode 100644 index 0000000000000..b949bc9504f5f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleIsCompressionEnabled.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates whether content compression is enabled. If compression is enabled, content will be served as compressed if + * user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is + * smaller than 1 byte or larger than 1 MB. + */ +public final class RuleIsCompressionEnabled extends ExpandableStringEnum { + /** Static value Enabled for RuleIsCompressionEnabled. */ + public static final RuleIsCompressionEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for RuleIsCompressionEnabled. */ + public static final RuleIsCompressionEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a RuleIsCompressionEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleIsCompressionEnabled. + */ + @JsonCreator + public static RuleIsCompressionEnabled fromString(String name) { + return fromString(name, RuleIsCompressionEnabled.class); + } + + /** + * Gets known RuleIsCompressionEnabled values. + * + * @return known RuleIsCompressionEnabled values. + */ + public static Collection values() { + return values(RuleIsCompressionEnabled.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java new file mode 100644 index 0000000000000..e19acbe728fa9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list rules. It contains a list of rule objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class RuleListResult { + /* + * List of AzureFrontDoor rules within a rule set. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of rule objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RuleListResult class. */ + public RuleListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor rules within a rule set. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of rule objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of rule objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RuleListResult object itself. + */ + public RuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.java new file mode 100644 index 0000000000000..71ae37b0a79da --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleQueryStringCachingBehavior.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines how Frontdoor caches requests that include query strings. You can ignore any query strings when caching, + * ignore specific query strings, cache every request with a unique URL, or cache specific query strings. + */ +public final class RuleQueryStringCachingBehavior extends ExpandableStringEnum { + /** Static value IgnoreQueryString for RuleQueryStringCachingBehavior. */ + public static final RuleQueryStringCachingBehavior IGNORE_QUERY_STRING = fromString("IgnoreQueryString"); + + /** Static value UseQueryString for RuleQueryStringCachingBehavior. */ + public static final RuleQueryStringCachingBehavior USE_QUERY_STRING = fromString("UseQueryString"); + + /** Static value IgnoreSpecifiedQueryStrings for RuleQueryStringCachingBehavior. */ + public static final RuleQueryStringCachingBehavior IGNORE_SPECIFIED_QUERY_STRINGS = + fromString("IgnoreSpecifiedQueryStrings"); + + /** Static value IncludeSpecifiedQueryStrings for RuleQueryStringCachingBehavior. */ + public static final RuleQueryStringCachingBehavior INCLUDE_SPECIFIED_QUERY_STRINGS = + fromString("IncludeSpecifiedQueryStrings"); + + /** + * Creates or finds a RuleQueryStringCachingBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleQueryStringCachingBehavior. + */ + @JsonCreator + public static RuleQueryStringCachingBehavior fromString(String name) { + return fromString(name, RuleQueryStringCachingBehavior.class); + } + + /** + * Gets known RuleQueryStringCachingBehavior values. + * + * @return known RuleQueryStringCachingBehavior values. + */ + public static Collection values() { + return values(RuleQueryStringCachingBehavior.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java new file mode 100644 index 0000000000000..6043739b347eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; + +/** An immutable client-side representation of RuleSet. */ +public interface RuleSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the rule set. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner object. + * + * @return the inner object. + */ + RuleSetInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java new file mode 100644 index 0000000000000..4f6c5c278a603 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list rule sets. It contains a list of rule set objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class RuleSetListResult { + /* + * List of AzureFrontDoor rule sets within a profile. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of rule set objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RuleSetListResult class. */ + public RuleSetListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor rule sets within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of rule set objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of rule set objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the RuleSetListResult object itself. + */ + public RuleSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.java new file mode 100644 index 0000000000000..7b4189cac6cca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 RuleSets. */ +public interface RuleSets { + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor rule sets within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rule sets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + */ + RuleSet get(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 friendly RuleSet name mapping to the any RuleSet or secret related information along with {@link + * Response}. + */ + Response createWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Creates a new rule set within the specified profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return friendly RuleSet name mapping to the any RuleSet or secret related information. + */ + RuleSet create(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String ruleSetName); + + /** + * Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, + * resource group and profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 profileName, String ruleSetName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile which is unique globally. + * @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 list usages operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String ruleSetName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java new file mode 100644 index 0000000000000..a430f47c13e0e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleUpdatePropertiesParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The domain JSON object required for domain creation or update. */ +@Fluent +public final class RuleUpdateParameters { + /* + * The JSON object that contains the properties of the rule to update. + */ + @JsonProperty(value = "properties") + private RuleUpdatePropertiesParameters innerProperties; + + /** Creates an instance of RuleUpdateParameters class. */ + public RuleUpdateParameters() { + } + + /** + * Get the innerProperties property: The JSON object that contains the properties of the rule to update. + * + * @return the innerProperties value. + */ + private RuleUpdatePropertiesParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the ruleSetName property: The name of the rule set containing the rule. + * + * @return the ruleSetName value. + */ + public String ruleSetName() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetName(); + } + + /** + * Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @return the order value. + */ + public Integer order() { + return this.innerProperties() == null ? null : this.innerProperties().order(); + } + + /** + * Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. + * A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special + * rule. It does not require any condition and actions listed in it will always be applied. + * + * @param order the order value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withOrder(Integer order) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withOrder(order); + return this; + } + + /** + * Get the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: A list of conditions that must be matched for the actions to be executed. + * + * @param conditions the conditions value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied. + * + * @param actions the actions value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @return the matchProcessingBehavior value. + */ + public MatchProcessingBehavior matchProcessingBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().matchProcessingBehavior(); + } + + /** + * Set the matchProcessingBehavior property: If this rule is a match should the rules engine continue running the + * remaining rules or stop. If not present, defaults to Continue. + * + * @param matchProcessingBehavior the matchProcessingBehavior value to set. + * @return the RuleUpdateParameters object itself. + */ + public RuleUpdateParameters withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new RuleUpdatePropertiesParameters(); + } + this.innerProperties().withMatchProcessingBehavior(matchProcessingBehavior); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.java new file mode 100644 index 0000000000000..c4fc64532a7ad --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Rules. */ +public interface Rules { + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + PagedIterable listByRuleSet(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Lists all of the existing delivery rules within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list rules as paginated response with {@link PagedIterable}. + */ + PagedIterable listByRuleSet( + String resourceGroupName, String profileName, String ruleSetName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @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 an existing delivery rule within a rule set along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing delivery rule within a rule set. + */ + Rule get(String resourceGroupName, String profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String ruleSetName, String ruleName); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param ruleSetName Name of the rule set under the profile. + * @param ruleName Name of the delivery rule which is unique within the endpoint. + * @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 profileName, String ruleSetName, String ruleName, Context context); + + /** + * Gets an existing delivery rule within a rule set. + * + * @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 an existing delivery rule within a rule set along with {@link Response}. + */ + Rule getById(String id); + + /** + * Gets an existing delivery rule within a rule set. + * + * @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 an existing delivery rule within a rule set along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing delivery rule within a rule set. + * + * @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 an existing delivery rule within a rule set. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Rule resource. + * + * @param name resource name. + * @return the first stage of the new Rule definition. + */ + Rule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.java new file mode 100644 index 0000000000000..d5035b82d3c20 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; + +/** An immutable client-side representation of Secret. */ +public interface Secret { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the secret. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + SecretParameters parameters(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner object. + * + * @return the inner object. + */ + SecretInner innerModel(); + + /** The entirety of the Secret definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Secret definition stages. */ + interface DefinitionStages { + /** The first stage of the Secret definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Secret definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the Secret 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.WithParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + Secret create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Secret create(Context context); + } + /** The stage of the Secret definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains secret parameters. + * + * @param parameters object which contains secret parameters. + * @return the next definition stage. + */ + WithCreate withParameters(SecretParameters parameters); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Secret refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Secret refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java new file mode 100644 index 0000000000000..3cc4d02c7fee3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list secrets. It contains a list of Secret objects and a URL link to get the next set of + * results. + */ +@Fluent +public final class SecretListResult { + /* + * List of AzureFrontDoor secrets within a profile. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of Secret objects if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SecretListResult class. */ + public SecretListResult() { + } + + /** + * Get the value property: List of AzureFrontDoor secrets within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of Secret objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of Secret objects if there are any. + * + * @param nextLink the nextLink value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.java new file mode 100644 index 0000000000000..6394e3b34d648 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The json object containing secret parameters. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = SecretParameters.class) +@JsonTypeName("SecretParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "UrlSigningKey", value = UrlSigningKeyParameters.class), + @JsonSubTypes.Type(name = "ManagedCertificate", value = ManagedCertificateParameters.class), + @JsonSubTypes.Type(name = "CustomerCertificate", value = CustomerCertificateParameters.class), + @JsonSubTypes.Type( + name = "AzureFirstPartyManagedCertificate", + value = AzureFirstPartyManagedCertificateParameters.class) +}) +@Immutable +public class SecretParameters { + /** Creates an instance of SecretParameters class. */ + public SecretParameters() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.java new file mode 100644 index 0000000000000..6371fd1543766 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the secret resource. */ +public final class SecretType extends ExpandableStringEnum { + /** Static value UrlSigningKey for SecretType. */ + public static final SecretType URL_SIGNING_KEY = fromString("UrlSigningKey"); + + /** Static value CustomerCertificate for SecretType. */ + public static final SecretType CUSTOMER_CERTIFICATE = fromString("CustomerCertificate"); + + /** Static value ManagedCertificate for SecretType. */ + public static final SecretType MANAGED_CERTIFICATE = fromString("ManagedCertificate"); + + /** Static value AzureFirstPartyManagedCertificate for SecretType. */ + public static final SecretType AZURE_FIRST_PARTY_MANAGED_CERTIFICATE = + fromString("AzureFirstPartyManagedCertificate"); + + /** + * Creates or finds a SecretType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretType. + */ + @JsonCreator + public static SecretType fromString(String name) { + return fromString(name, SecretType.class); + } + + /** + * Gets known SecretType values. + * + * @return known SecretType values. + */ + public static Collection values() { + return values(SecretType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java new file mode 100644 index 0000000000000..9bb71354f5795 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 Secrets. */ +public interface Secrets { + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list secrets as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @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 an existing Secret within a profile along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String profileName, String secretName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing Secret within a profile. + */ + Secret get(String resourceGroupName, String profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String secretName); + + /** + * Deletes an existing Secret within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param secretName Name of the Secret under the profile. + * @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 profileName, String secretName, Context context); + + /** + * Gets an existing Secret within a profile. + * + * @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 an existing Secret within a profile along with {@link Response}. + */ + Secret getById(String id); + + /** + * Gets an existing Secret within a profile. + * + * @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 an existing Secret within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing Secret within profile. + * + * @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 an existing Secret within profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Secret resource. + * + * @param name resource name. + * @return the first stage of the new Secret definition. + */ + Secret.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java new file mode 100644 index 0000000000000..ad4d926ebec42 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.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 SecurityPolicies. */ +public interface SecurityPolicies { + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName); + + /** + * Lists security policies associated with the profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list security policies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProfile(String resourceGroupName, String profileName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @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 an existing security policy within a profile along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing security policy within a profile. + */ + SecurityPolicy get(String resourceGroupName, String profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 profileName, String securityPolicyName); + + /** + * Deletes an existing security policy within profile. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique + * within the resource group. + * @param securityPolicyName Name of the security policy under the profile. + * @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 profileName, String securityPolicyName, Context context); + + /** + * Gets an existing security policy within a profile. + * + * @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 an existing security policy within a profile along with {@link Response}. + */ + SecurityPolicy getById(String id); + + /** + * Gets an existing security policy within a profile. + * + * @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 an existing security policy within a profile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing security policy within profile. + * + * @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 an existing security policy within profile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecurityPolicy resource. + * + * @param name resource name. + * @return the first stage of the new SecurityPolicy definition. + */ + SecurityPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java new file mode 100644 index 0000000000000..5dbd071203124 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; + +/** An immutable client-side representation of SecurityPolicy. */ +public interface SecurityPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the profileName property: The name of the profile which holds the security policy. + * + * @return the profileName value. + */ + String profileName(); + + /** + * Gets the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + SecurityPolicyPropertiesParameters parameters(); + + /** + * Gets the provisioningState property: Provisioning status. + * + * @return the provisioningState value. + */ + AfdProvisioningState provisioningState(); + + /** + * Gets the deploymentStatus property: The deploymentStatus property. + * + * @return the deploymentStatus value. + */ + DeploymentStatus deploymentStatus(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner object. + * + * @return the inner object. + */ + SecurityPolicyInner innerModel(); + + /** The entirety of the SecurityPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SecurityPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SecurityPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, profileName. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is + * unique within the resource group. + * @return the next definition stage. + */ + WithCreate withExistingProfile(String resourceGroupName, String profileName); + } + /** + * The stage of the SecurityPolicy 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.WithParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityPolicy create(Context context); + } + /** The stage of the SecurityPolicy definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains security policy parameters. + * + * @param parameters object which contains security policy parameters. + * @return the next definition stage. + */ + WithCreate withParameters(SecurityPolicyPropertiesParameters parameters); + } + } + /** + * Begins update for the SecurityPolicy resource. + * + * @return the stage of resource update. + */ + SecurityPolicy.Update update(); + + /** The template for SecurityPolicy update. */ + interface Update extends UpdateStages.WithParameters { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityPolicy apply(Context context); + } + /** The SecurityPolicy update stages. */ + interface UpdateStages { + /** The stage of the SecurityPolicy update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: object which contains security policy parameters. + * + * @param parameters object which contains security policy parameters. + * @return the next definition stage. + */ + Update withParameters(SecurityPolicyPropertiesParameters parameters); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityPolicy refresh(Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java new file mode 100644 index 0000000000000..1bc4cbaf0f8e5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list security policies. It contains a list of security policy objects and a URL link to get + * the next set of results. + */ +@Fluent +public final class SecurityPolicyListResult { + /* + * List of Security policies within a profile + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of security policy objects if there is any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SecurityPolicyListResult class. */ + public SecurityPolicyListResult() { + } + + /** + * Get the value property: List of Security policies within a profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of security policy objects if there is any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of security policy objects if there is any. + * + * @param nextLink the nextLink value to set. + * @return the SecurityPolicyListResult object itself. + */ + public SecurityPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.java new file mode 100644 index 0000000000000..f666220fdaa64 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyPropertiesParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The json object containing security policy parameters. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = SecurityPolicyPropertiesParameters.class) +@JsonTypeName("SecurityPolicyPropertiesParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "WebApplicationFirewall", value = SecurityPolicyWebApplicationFirewallParameters.class) +}) +@Immutable +public class SecurityPolicyPropertiesParameters { + /** Creates an instance of SecurityPolicyPropertiesParameters class. */ + public SecurityPolicyPropertiesParameters() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.java new file mode 100644 index 0000000000000..5fb03c0fdb967 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the Security policy to create. */ +public final class SecurityPolicyType extends ExpandableStringEnum { + /** Static value WebApplicationFirewall for SecurityPolicyType. */ + public static final SecurityPolicyType WEB_APPLICATION_FIREWALL = fromString("WebApplicationFirewall"); + + /** + * Creates or finds a SecurityPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityPolicyType. + */ + @JsonCreator + public static SecurityPolicyType fromString(String name) { + return fromString(name, SecurityPolicyType.class); + } + + /** + * Gets known SecurityPolicyType values. + * + * @return known SecurityPolicyType values. + */ + public static Collection values() { + return values(SecurityPolicyType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.java new file mode 100644 index 0000000000000..db7cbbf5394fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyUpdateParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object containing security policy update parameters. */ +@Fluent +public final class SecurityPolicyUpdateParameters { + /* + * The json object that contains properties required to update a security policy + */ + @JsonProperty(value = "properties") + private SecurityPolicyUpdateProperties innerProperties; + + /** Creates an instance of SecurityPolicyUpdateParameters class. */ + public SecurityPolicyUpdateParameters() { + } + + /** + * Get the innerProperties property: The json object that contains properties required to update a security policy. + * + * @return the innerProperties value. + */ + private SecurityPolicyUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyPropertiesParameters parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: object which contains security policy parameters. + * + * @param parameters the parameters value to set. + * @return the SecurityPolicyUpdateParameters object itself. + */ + public SecurityPolicyUpdateParameters withParameters(SecurityPolicyPropertiesParameters parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPolicyUpdateProperties(); + } + this.innerProperties().withParameters(parameters); + 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.java new file mode 100644 index 0000000000000..4f10f3fae304c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** settings for security policy patterns to match. */ +@Fluent +public final class SecurityPolicyWebApplicationFirewallAssociation { + /* + * List of domains. + */ + @JsonProperty(value = "domains") + private List domains; + + /* + * List of paths + */ + @JsonProperty(value = "patternsToMatch") + private List patternsToMatch; + + /** Creates an instance of SecurityPolicyWebApplicationFirewallAssociation class. */ + public SecurityPolicyWebApplicationFirewallAssociation() { + } + + /** + * Get the domains property: List of domains. + * + * @return the domains value. + */ + public List domains() { + return this.domains; + } + + /** + * Set the domains property: List of domains. + * + * @param domains the domains value to set. + * @return the SecurityPolicyWebApplicationFirewallAssociation object itself. + */ + public SecurityPolicyWebApplicationFirewallAssociation withDomains(List domains) { + this.domains = domains; + return this; + } + + /** + * Get the patternsToMatch property: List of paths. + * + * @return the patternsToMatch value. + */ + public List patternsToMatch() { + return this.patternsToMatch; + } + + /** + * Set the patternsToMatch property: List of paths. + * + * @param patternsToMatch the patternsToMatch value to set. + * @return the SecurityPolicyWebApplicationFirewallAssociation object itself. + */ + public SecurityPolicyWebApplicationFirewallAssociation withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domains() != null) { + domains().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.java new file mode 100644 index 0000000000000..dfcb8e6a29d67 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The json object containing security policy waf parameters. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("WebApplicationFirewall") +@Fluent +public final class SecurityPolicyWebApplicationFirewallParameters extends SecurityPolicyPropertiesParameters { + /* + * Resource ID. + */ + @JsonProperty(value = "wafPolicy") + private ResourceReference wafPolicy; + + /* + * Waf associations + */ + @JsonProperty(value = "associations") + private List associations; + + /** Creates an instance of SecurityPolicyWebApplicationFirewallParameters class. */ + public SecurityPolicyWebApplicationFirewallParameters() { + } + + /** + * Get the wafPolicy property: Resource ID. + * + * @return the wafPolicy value. + */ + public ResourceReference wafPolicy() { + return this.wafPolicy; + } + + /** + * Set the wafPolicy property: Resource ID. + * + * @param wafPolicy the wafPolicy value to set. + * @return the SecurityPolicyWebApplicationFirewallParameters object itself. + */ + public SecurityPolicyWebApplicationFirewallParameters withWafPolicy(ResourceReference wafPolicy) { + this.wafPolicy = wafPolicy; + return this; + } + + /** + * Get the associations property: Waf associations. + * + * @return the associations value. + */ + public List associations() { + return this.associations; + } + + /** + * Set the associations property: Waf associations. + * + * @param associations the associations value to set. + * @return the SecurityPolicyWebApplicationFirewallParameters object itself. + */ + public SecurityPolicyWebApplicationFirewallParameters withAssociations( + List associations) { + this.associations = associations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (wafPolicy() != null) { + wafPolicy().validate(); + } + if (associations() != null) { + associations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java new file mode 100644 index 0000000000000..3429e91dc9949 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for ServerPort match conditions. */ +@Fluent +public final class ServerPortMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleServerPortConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private ServerPortOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of ServerPortMatchConditionParameters class. */ + public ServerPortMatchConditionParameters() { + typeName = "DeliveryRuleServerPortConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public ServerPortOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withOperator(ServerPortOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the ServerPortMatchConditionParameters object itself. + */ + public ServerPortMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model ServerPortMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerPortMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.java new file mode 100644 index 0000000000000..c07dfd89e9e73 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServerPortOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class ServerPortOperator extends ExpandableStringEnum { + /** Static value Any for ServerPortOperator. */ + public static final ServerPortOperator ANY = fromString("Any"); + + /** Static value Equal for ServerPortOperator. */ + public static final ServerPortOperator EQUAL = fromString("Equal"); + + /** Static value Contains for ServerPortOperator. */ + public static final ServerPortOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for ServerPortOperator. */ + public static final ServerPortOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for ServerPortOperator. */ + public static final ServerPortOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for ServerPortOperator. */ + public static final ServerPortOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for ServerPortOperator. */ + public static final ServerPortOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for ServerPortOperator. */ + public static final ServerPortOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for ServerPortOperator. */ + public static final ServerPortOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for ServerPortOperator. */ + public static final ServerPortOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a ServerPortOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerPortOperator. + */ + @JsonCreator + public static ServerPortOperator fromString(String name) { + return fromString(name, ServerPortOperator.class); + } + + /** + * Gets known ServerPortOperator values. + * + * @return known ServerPortOperator values. + */ + public static Collection values() { + return values(ServerPortOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java new file mode 100644 index 0000000000000..49015aa7104f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include log specifications. */ +@Fluent +public final class ServiceSpecification { + /* + * Log specifications of operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** Creates an instance of ServiceSpecification class. */ + public ServiceSpecification() { + } + + /** + * Get the logSpecifications property: Log specifications of operation. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Log specifications of operation. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..2558e80037266 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of an existing Shared Private Link Resource to use when connecting to a private origin. */ +@Fluent +public final class SharedPrivateLinkResourceProperties { + /* + * The resource id of the resource the shared private link resource is for. + */ + @JsonProperty(value = "privateLink") + private ResourceReference privateLink; + + /* + * The location of the shared private link resource + */ + @JsonProperty(value = "privateLinkLocation") + private String privateLinkLocation; + + /* + * The group id from the provider of resource the shared private link resource is for. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The request message for requesting approval of the shared private link resource. + */ + @JsonProperty(value = "requestMessage") + private String requestMessage; + + /* + * Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. + */ + @JsonProperty(value = "status") + private SharedPrivateLinkResourceStatus status; + + /** Creates an instance of SharedPrivateLinkResourceProperties class. */ + public SharedPrivateLinkResourceProperties() { + } + + /** + * Get the privateLink property: The resource id of the resource the shared private link resource is for. + * + * @return the privateLink value. + */ + public ResourceReference privateLink() { + return this.privateLink; + } + + /** + * Set the privateLink property: The resource id of the resource the shared private link resource is for. + * + * @param privateLink the privateLink value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withPrivateLink(ResourceReference privateLink) { + this.privateLink = privateLink; + return this; + } + + /** + * Get the privateLinkLocation property: The location of the shared private link resource. + * + * @return the privateLinkLocation value. + */ + public String privateLinkLocation() { + return this.privateLinkLocation; + } + + /** + * Set the privateLinkLocation property: The location of the shared private link resource. + * + * @param privateLinkLocation the privateLinkLocation value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withPrivateLinkLocation(String privateLinkLocation) { + this.privateLinkLocation = privateLinkLocation; + return this; + } + + /** + * Get the groupId property: The group id from the provider of resource the shared private link resource is for. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group id from the provider of resource the shared private link resource is for. + * + * @param groupId the groupId value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requestMessage property: The request message for requesting approval of the shared private link resource. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the requestMessage property: The request message for requesting approval of the shared private link resource. + * + * @param requestMessage the requestMessage value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get the status property: Status of the shared private link resource. Can be Pending, Approved, Rejected, + * Disconnected, or Timeout. + * + * @return the status value. + */ + public SharedPrivateLinkResourceStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the shared private link resource. Can be Pending, Approved, Rejected, + * Disconnected, or Timeout. + * + * @param status the status value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withStatus(SharedPrivateLinkResourceStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateLink() != null) { + privateLink().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.java new file mode 100644 index 0000000000000..4a4f446854050 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. */ +public enum SharedPrivateLinkResourceStatus { + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value Approved. */ + APPROVED("Approved"), + + /** Enum value Rejected. */ + REJECTED("Rejected"), + + /** Enum value Disconnected. */ + DISCONNECTED("Disconnected"), + + /** Enum value Timeout. */ + TIMEOUT("Timeout"); + + /** The actual serialized value for a SharedPrivateLinkResourceStatus instance. */ + private final String value; + + SharedPrivateLinkResourceStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SharedPrivateLinkResourceStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed SharedPrivateLinkResourceStatus object, or null if unable to parse. + */ + @JsonCreator + public static SharedPrivateLinkResourceStatus fromString(String value) { + if (value == null) { + return null; + } + SharedPrivateLinkResourceStatus[] items = SharedPrivateLinkResourceStatus.values(); + for (SharedPrivateLinkResourceStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.java new file mode 100644 index 0000000000000..e7611a068b0eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Standard_Verizon = The SKU name for a Standard Verizon CDN profile. Premium_Verizon = The SKU name for a Premium + * Verizon CDN profile. Custom_Verizon = The SKU name for a Custom Verizon CDN profile. Standard_Akamai = The SKU name + * for an Akamai CDN profile. Standard_ChinaCdn = The SKU name for a China CDN profile for VOD, Web and download + * scenarios using GB based billing model. Standard_Microsoft = The SKU name for a Standard Microsoft CDN profile. + * Standard_AzureFrontDoor = The SKU name for an Azure Front Door Standard profile. Premium_AzureFrontDoor = The SKU + * name for an Azure Front Door Premium profile. Standard_955BandWidth_ChinaCdn = The SKU name for a China CDN profile + * for VOD, Web and download scenarios using 95-5 peak bandwidth billing model. Standard_AvgBandWidth_ChinaCdn = The SKU + * name for a China CDN profile for VOD, Web and download scenarios using monthly average peak bandwidth billing model. + * StandardPlus_ChinaCdn = The SKU name for a China CDN profile for live-streaming using GB based billing model. + * StandardPlus_955BandWidth_ChinaCdn = The SKU name for a China CDN live-streaming profile using 95-5 peak bandwidth + * billing model. StandardPlus_AvgBandWidth_ChinaCdn = The SKU name for a China CDN live-streaming profile using monthly + * average peak bandwidth billing model. + */ +@Fluent +public final class Sku { + /* + * Name of the pricing tier. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: Name of the pricing tier. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Name of the pricing tier. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.java new file mode 100644 index 0000000000000..01338e7b6b221 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Name of the pricing tier. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard_Verizon for SkuName. */ + public static final SkuName STANDARD_VERIZON = fromString("Standard_Verizon"); + + /** Static value Premium_Verizon for SkuName. */ + public static final SkuName PREMIUM_VERIZON = fromString("Premium_Verizon"); + + /** Static value Custom_Verizon for SkuName. */ + public static final SkuName CUSTOM_VERIZON = fromString("Custom_Verizon"); + + /** Static value Standard_Akamai for SkuName. */ + public static final SkuName STANDARD_AKAMAI = fromString("Standard_Akamai"); + + /** Static value Standard_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_CHINA_CDN = fromString("Standard_ChinaCdn"); + + /** Static value Standard_Microsoft for SkuName. */ + public static final SkuName STANDARD_MICROSOFT = fromString("Standard_Microsoft"); + + /** Static value Standard_AzureFrontDoor for SkuName. */ + public static final SkuName STANDARD_AZURE_FRONT_DOOR = fromString("Standard_AzureFrontDoor"); + + /** Static value Premium_AzureFrontDoor for SkuName. */ + public static final SkuName PREMIUM_AZURE_FRONT_DOOR = fromString("Premium_AzureFrontDoor"); + + /** Static value Standard_955BandWidth_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_955BAND_WIDTH_CHINA_CDN = fromString("Standard_955BandWidth_ChinaCdn"); + + /** Static value Standard_AvgBandWidth_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_AVG_BAND_WIDTH_CHINA_CDN = fromString("Standard_AvgBandWidth_ChinaCdn"); + + /** Static value StandardPlus_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_PLUS_CHINA_CDN = fromString("StandardPlus_ChinaCdn"); + + /** Static value StandardPlus_955BandWidth_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_PLUS_955BAND_WIDTH_CHINA_CDN = + fromString("StandardPlus_955BandWidth_ChinaCdn"); + + /** Static value StandardPlus_AvgBandWidth_ChinaCdn for SkuName. */ + public static final SkuName STANDARD_PLUS_AVG_BAND_WIDTH_CHINA_CDN = + fromString("StandardPlus_AvgBandWidth_ChinaCdn"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java new file mode 100644 index 0000000000000..cdfc608e10f49 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for SocketAddress match conditions. */ +@Fluent +public final class SocketAddrMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleSocketAddrConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private SocketAddrOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of SocketAddrMatchConditionParameters class. */ + public SocketAddrMatchConditionParameters() { + typeName = "DeliveryRuleSocketAddrConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public SocketAddrOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withOperator(SocketAddrOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the SocketAddrMatchConditionParameters object itself. + */ + public SocketAddrMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model SocketAddrMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SocketAddrMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java new file mode 100644 index 0000000000000..739ef56772c7b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SocketAddrOperator.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class SocketAddrOperator extends ExpandableStringEnum { + /** Static value Any for SocketAddrOperator. */ + public static final SocketAddrOperator ANY = fromString("Any"); + + /** Static value IPMatch for SocketAddrOperator. */ + public static final SocketAddrOperator IPMATCH = fromString("IPMatch"); + + /** + * Creates or finds a SocketAddrOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding SocketAddrOperator. + */ + @JsonCreator + public static SocketAddrOperator fromString(String name) { + return fromString(name, SocketAddrOperator.class); + } + + /** + * Gets known SocketAddrOperator values. + * + * @return known SocketAddrOperator values. + */ + public static Collection values() { + return values(SocketAddrOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.java new file mode 100644 index 0000000000000..ee3a0042a5951 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocol.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The protocol of an established TLS connection. */ +public final class SslProtocol extends ExpandableStringEnum { + /** Static value TLSv1 for SslProtocol. */ + public static final SslProtocol TLSV1 = fromString("TLSv1"); + + /** Static value TLSv1.1 for SslProtocol. */ + public static final SslProtocol TLSV1_1 = fromString("TLSv1.1"); + + /** Static value TLSv1.2 for SslProtocol. */ + public static final SslProtocol TLSV1_2 = fromString("TLSv1.2"); + + /** + * Creates or finds a SslProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslProtocol. + */ + @JsonCreator + public static SslProtocol fromString(String name) { + return fromString(name, SslProtocol.class); + } + + /** + * Gets known SslProtocol values. + * + * @return known SslProtocol values. + */ + public static Collection values() { + return values(SslProtocol.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java new file mode 100644 index 0000000000000..3a2f70ce75540 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for SslProtocol match conditions. */ +@Fluent +public final class SslProtocolMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleSslProtocolConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private SslProtocolOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of SslProtocolMatchConditionParameters class. */ + public SslProtocolMatchConditionParameters() { + typeName = "DeliveryRuleSslProtocolConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public SslProtocolOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withOperator(SslProtocolOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the SslProtocolMatchConditionParameters object itself. + */ + public SslProtocolMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model SslProtocolMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SslProtocolMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.java new file mode 100644 index 0000000000000..0261c6843b974 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SslProtocolOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class SslProtocolOperator extends ExpandableStringEnum { + /** Static value Equal for SslProtocolOperator. */ + public static final SslProtocolOperator EQUAL = fromString("Equal"); + + /** + * Creates or finds a SslProtocolOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslProtocolOperator. + */ + @JsonCreator + public static SslProtocolOperator fromString(String name) { + return fromString(name, SslProtocolOperator.class); + } + + /** + * Gets known SslProtocolOperator values. + * + * @return known SslProtocolOperator values. + */ + public static Collection values() { + return values(SslProtocolOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java new file mode 100644 index 0000000000000..5134208a9733d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner; + +/** An immutable client-side representation of SsoUri. */ +public interface SsoUri { + /** + * Gets the ssoUriValue property: The URI used to login to the supplemental portal. + * + * @return the ssoUriValue value. + */ + String ssoUriValue(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SsoUriInner object. + * + * @return the inner object. + */ + SsoUriInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.java new file mode 100644 index 0000000000000..2b34cbbdfeeec --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The validation status. */ +public final class Status extends ExpandableStringEnum { + /** Static value Valid for Status. */ + public static final Status VALID = fromString("Valid"); + + /** Static value Invalid for Status. */ + public static final Status INVALID = fromString("Invalid"); + + /** Static value AccessDenied for Status. */ + public static final Status ACCESS_DENIED = fromString("AccessDenied"); + + /** Static value CertificateExpired for Status. */ + public static final Status CERTIFICATE_EXPIRED = fromString("CertificateExpired"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java new file mode 100644 index 0000000000000..da45d91a23e8a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.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.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner; +import java.util.List; + +/** An immutable client-side representation of SupportedOptimizationTypesListResult. */ +public interface SupportedOptimizationTypesListResult { + /** + * Gets the supportedOptimizationTypes property: Supported optimization types for a profile. + * + * @return the supportedOptimizationTypes value. + */ + List supportedOptimizationTypes(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.SupportedOptimizationTypesListResultInner + * object. + * + * @return the inner object. + */ + SupportedOptimizationTypesListResultInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java new file mode 100644 index 0000000000000..ff23d9456c44f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes what transforms are applied before matching. */ +public final class Transform extends ExpandableStringEnum { + /** Static value Lowercase for Transform. */ + public static final Transform LOWERCASE = fromString("Lowercase"); + + /** Static value Uppercase for Transform. */ + public static final Transform UPPERCASE = fromString("Uppercase"); + + /** Static value Trim for Transform. */ + public static final Transform TRIM = fromString("Trim"); + + /** Static value UrlDecode for Transform. */ + public static final Transform URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for Transform. */ + public static final Transform URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for Transform. */ + public static final Transform REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates or finds a Transform from its string representation. + * + * @param name a name to look for. + * @return the corresponding Transform. + */ + @JsonCreator + public static Transform fromString(String name) { + return fromString(name, Transform.class); + } + + /** + * Gets known Transform values. + * + * @return known Transform values. + */ + public static Collection values() { + return values(Transform.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java new file mode 100644 index 0000000000000..13d97608713c5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes what transforms were applied before matching. */ +public final class TransformType extends ExpandableStringEnum { + /** Static value Lowercase for TransformType. */ + public static final TransformType LOWERCASE = fromString("Lowercase"); + + /** Static value Uppercase for TransformType. */ + public static final TransformType UPPERCASE = fromString("Uppercase"); + + /** Static value Trim for TransformType. */ + public static final TransformType TRIM = fromString("Trim"); + + /** Static value UrlDecode for TransformType. */ + public static final TransformType URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for TransformType. */ + public static final TransformType URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for TransformType. */ + public static final TransformType REMOVE_NULLS = fromString("RemoveNulls"); + + /** + * Creates or finds a TransformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransformType. + */ + @JsonCreator + public static TransformType fromString(String name) { + return fromString(name, TransformType.class); + } + + /** + * Gets known TransformType values. + * + * @return known TransformType values. + */ + public static Collection values() { + return values(TransformType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.java new file mode 100644 index 0000000000000..83c0f876ffbac --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes the action that shall be taken when the certificate is updated in Key Vault. */ +public final class UpdateRule extends ExpandableStringEnum { + /** Static value NoAction for UpdateRule. */ + public static final UpdateRule NO_ACTION = fromString("NoAction"); + + /** + * Creates or finds a UpdateRule from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRule. + */ + @JsonCreator + public static UpdateRule fromString(String name) { + return fromString(name, UpdateRule.class); + } + + /** + * Gets known UpdateRule values. + * + * @return known UpdateRule values. + */ + public static Collection values() { + return values(UpdateRule.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java new file mode 100644 index 0000000000000..c67d0c22003c4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlFileExtension match conditions. */ +@Fluent +public final class UrlFileExtensionMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlFileExtensionMatchConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private UrlFileExtensionOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of UrlFileExtensionMatchConditionParameters class. */ + public UrlFileExtensionMatchConditionParameters() { + typeName = "DeliveryRuleUrlFileExtensionMatchConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public UrlFileExtensionOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withOperator(UrlFileExtensionOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model UrlFileExtensionMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlFileExtensionMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.java new file mode 100644 index 0000000000000..d5ffb541eb92f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class UrlFileExtensionOperator extends ExpandableStringEnum { + /** Static value Any for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator ANY = fromString("Any"); + + /** Static value Equal for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator EQUAL = fromString("Equal"); + + /** Static value Contains for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for UrlFileExtensionOperator. */ + public static final UrlFileExtensionOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a UrlFileExtensionOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlFileExtensionOperator. + */ + @JsonCreator + public static UrlFileExtensionOperator fromString(String name) { + return fromString(name, UrlFileExtensionOperator.class); + } + + /** + * Gets known UrlFileExtensionOperator values. + * + * @return known UrlFileExtensionOperator values. + */ + public static Collection values() { + return values(UrlFileExtensionOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java new file mode 100644 index 0000000000000..036b09d872536 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlFilename match conditions. */ +@Fluent +public final class UrlFileNameMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlFilenameConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private UrlFileNameOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of UrlFileNameMatchConditionParameters class. */ + public UrlFileNameMatchConditionParameters() { + typeName = "DeliveryRuleUrlFilenameConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public UrlFileNameOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withOperator(UrlFileNameOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model UrlFileNameMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlFileNameMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.java new file mode 100644 index 0000000000000..98f08875bef3b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class UrlFileNameOperator extends ExpandableStringEnum { + /** Static value Any for UrlFileNameOperator. */ + public static final UrlFileNameOperator ANY = fromString("Any"); + + /** Static value Equal for UrlFileNameOperator. */ + public static final UrlFileNameOperator EQUAL = fromString("Equal"); + + /** Static value Contains for UrlFileNameOperator. */ + public static final UrlFileNameOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for UrlFileNameOperator. */ + public static final UrlFileNameOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for UrlFileNameOperator. */ + public static final UrlFileNameOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for UrlFileNameOperator. */ + public static final UrlFileNameOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for UrlFileNameOperator. */ + public static final UrlFileNameOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for UrlFileNameOperator. */ + public static final UrlFileNameOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for UrlFileNameOperator. */ + public static final UrlFileNameOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value RegEx for UrlFileNameOperator. */ + public static final UrlFileNameOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a UrlFileNameOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlFileNameOperator. + */ + @JsonCreator + public static UrlFileNameOperator fromString(String name) { + return fromString(name, UrlFileNameOperator.class); + } + + /** + * Gets known UrlFileNameOperator values. + * + * @return known UrlFileNameOperator values. + */ + public static Collection values() { + return values(UrlFileNameOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java new file mode 100644 index 0000000000000..4a5d165ecc157 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlPath match conditions. */ +@Fluent +public final class UrlPathMatchConditionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlPathMatchConditionParameters"; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private UrlPathOperator operator; + + /* + * Describes if this is negate condition or not + */ + @JsonProperty(value = "negateCondition") + private Boolean negateCondition; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /* + * List of transforms + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** Creates an instance of UrlPathMatchConditionParameters class. */ + public UrlPathMatchConditionParameters() { + typeName = "DeliveryRuleUrlPathMatchConditionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the operator property: Describes operator to be matched. + * + * @return the operator value. + */ + public UrlPathOperator operator() { + return this.operator; + } + + /** + * Set the operator property: Describes operator to be matched. + * + * @param operator the operator value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withOperator(UrlPathOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negateCondition property: Describes if this is negate condition or not. + * + * @return the negateCondition value. + */ + public Boolean negateCondition() { + return this.negateCondition; + } + + /** + * Set the negateCondition property: Describes if this is negate condition or not. + * + * @param negateCondition the negateCondition value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withNegateCondition(Boolean negateCondition) { + this.negateCondition = negateCondition; + return this; + } + + /** + * Get the matchValues property: The match value for the condition of the delivery rule. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: The match value for the condition of the delivery rule. + * + * @param matchValues the matchValues value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operator in model UrlPathMatchConditionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlPathMatchConditionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.java new file mode 100644 index 0000000000000..bd9d34b8dae0c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Describes operator to be matched. */ +public final class UrlPathOperator extends ExpandableStringEnum { + /** Static value Any for UrlPathOperator. */ + public static final UrlPathOperator ANY = fromString("Any"); + + /** Static value Equal for UrlPathOperator. */ + public static final UrlPathOperator EQUAL = fromString("Equal"); + + /** Static value Contains for UrlPathOperator. */ + public static final UrlPathOperator CONTAINS = fromString("Contains"); + + /** Static value BeginsWith for UrlPathOperator. */ + public static final UrlPathOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for UrlPathOperator. */ + public static final UrlPathOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value LessThan for UrlPathOperator. */ + public static final UrlPathOperator LESS_THAN = fromString("LessThan"); + + /** Static value LessThanOrEqual for UrlPathOperator. */ + public static final UrlPathOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThan for UrlPathOperator. */ + public static final UrlPathOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value GreaterThanOrEqual for UrlPathOperator. */ + public static final UrlPathOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value Wildcard for UrlPathOperator. */ + public static final UrlPathOperator WILDCARD = fromString("Wildcard"); + + /** Static value RegEx for UrlPathOperator. */ + public static final UrlPathOperator REG_EX = fromString("RegEx"); + + /** + * Creates or finds a UrlPathOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding UrlPathOperator. + */ + @JsonCreator + public static UrlPathOperator fromString(String name) { + return fromString(name, UrlPathOperator.class); + } + + /** + * Gets known UrlPathOperator values. + * + * @return known UrlPathOperator values. + */ + public static Collection values() { + return values(UrlPathOperator.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java new file mode 100644 index 0000000000000..b8daac6d2b342 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the url redirect action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlRedirect") +@Fluent +public final class UrlRedirectAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlRedirectActionParameters parameters; + + /** Creates an instance of UrlRedirectAction class. */ + public UrlRedirectAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public UrlRedirectActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the UrlRedirectAction object itself. + */ + public UrlRedirectAction withParameters(UrlRedirectActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property parameters in model UrlRedirectAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRedirectAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java new file mode 100644 index 0000000000000..b231fb8cf5216 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the url redirect action. */ +@Fluent +public final class UrlRedirectActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlRedirectActionParameters"; + + /* + * The redirect type the rule will use when redirecting traffic. + */ + @JsonProperty(value = "redirectType", required = true) + private RedirectType redirectType; + + /* + * Protocol to use for the redirect. The default value is MatchRequest + */ + @JsonProperty(value = "destinationProtocol") + private DestinationProtocol destinationProtocol; + + /* + * The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as + * destination path. + */ + @JsonProperty(value = "customPath") + private String customPath; + + /* + * Host to redirect. Leave empty to use the incoming host as the destination host. + */ + @JsonProperty(value = "customHostname") + private String customHostname; + + /* + * The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query + * string; leave empty to preserve the incoming query string. Query string must be in = format. ? and & + * will be added automatically so do not include them. + */ + @JsonProperty(value = "customQueryString") + private String customQueryString; + + /* + * Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. + */ + @JsonProperty(value = "customFragment") + private String customFragment; + + /** Creates an instance of UrlRedirectActionParameters class. */ + public UrlRedirectActionParameters() { + typeName = "DeliveryRuleUrlRedirectActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the redirectType property: The redirect type the rule will use when redirecting traffic. + * + * @return the redirectType value. + */ + public RedirectType redirectType() { + return this.redirectType; + } + + /** + * Set the redirectType property: The redirect type the rule will use when redirecting traffic. + * + * @param redirectType the redirectType value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withRedirectType(RedirectType redirectType) { + this.redirectType = redirectType; + return this; + } + + /** + * Get the destinationProtocol property: Protocol to use for the redirect. The default value is MatchRequest. + * + * @return the destinationProtocol value. + */ + public DestinationProtocol destinationProtocol() { + return this.destinationProtocol; + } + + /** + * Set the destinationProtocol property: Protocol to use for the redirect. The default value is MatchRequest. + * + * @param destinationProtocol the destinationProtocol value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withDestinationProtocol(DestinationProtocol destinationProtocol) { + this.destinationProtocol = destinationProtocol; + return this; + } + + /** + * Get the customPath property: The full path to redirect. Path cannot be empty and must start with /. Leave empty + * to use the incoming path as destination path. + * + * @return the customPath value. + */ + public String customPath() { + return this.customPath; + } + + /** + * Set the customPath property: The full path to redirect. Path cannot be empty and must start with /. Leave empty + * to use the incoming path as destination path. + * + * @param customPath the customPath value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withCustomPath(String customPath) { + this.customPath = customPath; + return this; + } + + /** + * Get the customHostname property: Host to redirect. Leave empty to use the incoming host as the destination host. + * + * @return the customHostname value. + */ + public String customHostname() { + return this.customHostname; + } + + /** + * Set the customHostname property: Host to redirect. Leave empty to use the incoming host as the destination host. + * + * @param customHostname the customHostname value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withCustomHostname(String customHostname) { + this.customHostname = customHostname; + return this; + } + + /** + * Get the customQueryString property: The set of query strings to be placed in the redirect URL. Setting this value + * would replace any existing query string; leave empty to preserve the incoming query string. Query string must be + * in <key>=<value> format. ? and & will be added automatically so do not include them. + * + * @return the customQueryString value. + */ + public String customQueryString() { + return this.customQueryString; + } + + /** + * Set the customQueryString property: The set of query strings to be placed in the redirect URL. Setting this value + * would replace any existing query string; leave empty to preserve the incoming query string. Query string must be + * in <key>=<value> format. ? and & will be added automatically so do not include them. + * + * @param customQueryString the customQueryString value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withCustomQueryString(String customQueryString) { + this.customQueryString = customQueryString; + return this; + } + + /** + * Get the customFragment property: Fragment to add to the redirect URL. Fragment is the part of the URL that comes + * after #. Do not include the #. + * + * @return the customFragment value. + */ + public String customFragment() { + return this.customFragment; + } + + /** + * Set the customFragment property: Fragment to add to the redirect URL. Fragment is the part of the URL that comes + * after #. Do not include the #. + * + * @param customFragment the customFragment value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withCustomFragment(String customFragment) { + this.customFragment = customFragment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (redirectType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property redirectType in model UrlRedirectActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRedirectActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.java new file mode 100644 index 0000000000000..00d8a4722a7af --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the url rewrite action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlRewrite") +@Fluent +public final class UrlRewriteAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlRewriteActionParameters parameters; + + /** Creates an instance of UrlRewriteAction class. */ + public UrlRewriteAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public UrlRewriteActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the UrlRewriteAction object itself. + */ + public UrlRewriteAction withParameters(UrlRewriteActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property parameters in model UrlRewriteAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRewriteAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.java new file mode 100644 index 0000000000000..463e53d30fa8e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the url rewrite action. */ +@Fluent +public final class UrlRewriteActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlRewriteActionParameters"; + + /* + * define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all + * strings are matched. + */ + @JsonProperty(value = "sourcePattern", required = true) + private String sourcePattern; + + /* + * Define the relative URL to which the above requests will be rewritten by. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * Whether to preserve unmatched path. Default value is true. + */ + @JsonProperty(value = "preserveUnmatchedPath") + private Boolean preserveUnmatchedPath; + + /** Creates an instance of UrlRewriteActionParameters class. */ + public UrlRewriteActionParameters() { + typeName = "DeliveryRuleUrlRewriteActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlRewriteActionParameters object itself. + */ + public UrlRewriteActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the sourcePattern property: define a request URI pattern that identifies the type of requests that may be + * rewritten. If value is blank, all strings are matched. + * + * @return the sourcePattern value. + */ + public String sourcePattern() { + return this.sourcePattern; + } + + /** + * Set the sourcePattern property: define a request URI pattern that identifies the type of requests that may be + * rewritten. If value is blank, all strings are matched. + * + * @param sourcePattern the sourcePattern value to set. + * @return the UrlRewriteActionParameters object itself. + */ + public UrlRewriteActionParameters withSourcePattern(String sourcePattern) { + this.sourcePattern = sourcePattern; + return this; + } + + /** + * Get the destination property: Define the relative URL to which the above requests will be rewritten by. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Define the relative URL to which the above requests will be rewritten by. + * + * @param destination the destination value to set. + * @return the UrlRewriteActionParameters object itself. + */ + public UrlRewriteActionParameters withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the preserveUnmatchedPath property: Whether to preserve unmatched path. Default value is true. + * + * @return the preserveUnmatchedPath value. + */ + public Boolean preserveUnmatchedPath() { + return this.preserveUnmatchedPath; + } + + /** + * Set the preserveUnmatchedPath property: Whether to preserve unmatched path. Default value is true. + * + * @param preserveUnmatchedPath the preserveUnmatchedPath value to set. + * @return the UrlRewriteActionParameters object itself. + */ + public UrlRewriteActionParameters withPreserveUnmatchedPath(Boolean preserveUnmatchedPath) { + this.preserveUnmatchedPath = preserveUnmatchedPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourcePattern() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourcePattern in model UrlRewriteActionParameters")); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model UrlRewriteActionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlRewriteActionParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.java new file mode 100644 index 0000000000000..91d897eb1bf25 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the url signing action for the delivery rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "name") +@JsonTypeName("UrlSigning") +@Fluent +public final class UrlSigningAction extends DeliveryRuleAction { + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlSigningActionParameters parameters; + + /** Creates an instance of UrlSigningAction class. */ + public UrlSigningAction() { + } + + /** + * Get the parameters property: Defines the parameters for the action. + * + * @return the parameters value. + */ + public UrlSigningActionParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Defines the parameters for the action. + * + * @param parameters the parameters value to set. + * @return the UrlSigningAction object itself. + */ + public UrlSigningAction withParameters(UrlSigningActionParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property parameters in model UrlSigningAction")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningAction.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.java new file mode 100644 index 0000000000000..0d2ee960cbb1f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for the Url Signing action. */ +@Fluent +public final class UrlSigningActionParameters { + /* + * The typeName property. + */ + @JsonProperty(value = "typeName", required = true) + private String typeName = "DeliveryRuleUrlSigningActionParameters"; + + /* + * Algorithm to use for URL signing + */ + @JsonProperty(value = "algorithm") + private Algorithm algorithm; + + /* + * Defines which query string parameters in the url to be considered for expires, key id etc. + */ + @JsonProperty(value = "parameterNameOverride") + private List parameterNameOverride; + + /** Creates an instance of UrlSigningActionParameters class. */ + public UrlSigningActionParameters() { + typeName = "DeliveryRuleUrlSigningActionParameters"; + } + + /** + * Get the typeName property: The typeName property. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: The typeName property. + * + * @param typeName the typeName value to set. + * @return the UrlSigningActionParameters object itself. + */ + public UrlSigningActionParameters withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the algorithm property: Algorithm to use for URL signing. + * + * @return the algorithm value. + */ + public Algorithm algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm property: Algorithm to use for URL signing. + * + * @param algorithm the algorithm value to set. + * @return the UrlSigningActionParameters object itself. + */ + public UrlSigningActionParameters withAlgorithm(Algorithm algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get the parameterNameOverride property: Defines which query string parameters in the url to be considered for + * expires, key id etc. + * + * @return the parameterNameOverride value. + */ + public List parameterNameOverride() { + return this.parameterNameOverride; + } + + /** + * Set the parameterNameOverride property: Defines which query string parameters in the url to be considered for + * expires, key id etc. + * + * @param parameterNameOverride the parameterNameOverride value to set. + * @return the UrlSigningActionParameters object itself. + */ + public UrlSigningActionParameters withParameterNameOverride(List parameterNameOverride) { + this.parameterNameOverride = parameterNameOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameterNameOverride() != null) { + parameterNameOverride().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.java new file mode 100644 index 0000000000000..c68c4d635c495 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Url signing key. */ +@Fluent +public final class UrlSigningKey { + /* + * Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form + * the hash. + */ + @JsonProperty(value = "keyId", required = true) + private String keyId; + + /* + * Defines the parameters for using customer key vault for Url Signing Key. + */ + @JsonProperty(value = "keySourceParameters", required = true) + private KeyVaultSigningKeyParameters keySourceParameters; + + /** Creates an instance of UrlSigningKey class. */ + public UrlSigningKey() { + } + + /** + * Get the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @param keyId the keyId value to set. + * @return the UrlSigningKey object itself. + */ + public UrlSigningKey withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the keySourceParameters property: Defines the parameters for using customer key vault for Url Signing Key. + * + * @return the keySourceParameters value. + */ + public KeyVaultSigningKeyParameters keySourceParameters() { + return this.keySourceParameters; + } + + /** + * Set the keySourceParameters property: Defines the parameters for using customer key vault for Url Signing Key. + * + * @param keySourceParameters the keySourceParameters value to set. + * @return the UrlSigningKey object itself. + */ + public UrlSigningKey withKeySourceParameters(KeyVaultSigningKeyParameters keySourceParameters) { + this.keySourceParameters = keySourceParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyId in model UrlSigningKey")); + } + if (keySourceParameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keySourceParameters in model UrlSigningKey")); + } else { + keySourceParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningKey.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java new file mode 100644 index 0000000000000..6ddfa8f3f38c4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Url signing key parameters. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("UrlSigningKey") +@Fluent +public final class UrlSigningKeyParameters extends SecretParameters { + /* + * Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form + * the hash. + */ + @JsonProperty(value = "keyId", required = true) + private String keyId; + + /* + * Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /** Creates an instance of UrlSigningKeyParameters class. */ + public UrlSigningKeyParameters() { + } + + /** + * Get the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Defines the customer defined key Id. This id will exist in the incoming request to + * indicate the key used to form the hash. + * + * @param keyId the keyId value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Version of the secret to be used. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Version of the secret to be used. + * + * @param secretVersion the secretVersion value to set. + * @return the UrlSigningKeyParameters object itself. + */ + public UrlSigningKeyParameters withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyId in model UrlSigningKeyParameters")); + } + if (secretSource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretSource in model UrlSigningKeyParameters")); + } else { + secretSource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningKeyParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.java new file mode 100644 index 0000000000000..738964c853840 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines how to identify a parameter for a specific purpose e.g. expires. */ +@Fluent +public final class UrlSigningParamIdentifier { + /* + * Indicates the purpose of the parameter + */ + @JsonProperty(value = "paramIndicator", required = true) + private ParamIndicator paramIndicator; + + /* + * Parameter name + */ + @JsonProperty(value = "paramName", required = true) + private String paramName; + + /** Creates an instance of UrlSigningParamIdentifier class. */ + public UrlSigningParamIdentifier() { + } + + /** + * Get the paramIndicator property: Indicates the purpose of the parameter. + * + * @return the paramIndicator value. + */ + public ParamIndicator paramIndicator() { + return this.paramIndicator; + } + + /** + * Set the paramIndicator property: Indicates the purpose of the parameter. + * + * @param paramIndicator the paramIndicator value to set. + * @return the UrlSigningParamIdentifier object itself. + */ + public UrlSigningParamIdentifier withParamIndicator(ParamIndicator paramIndicator) { + this.paramIndicator = paramIndicator; + return this; + } + + /** + * Get the paramName property: Parameter name. + * + * @return the paramName value. + */ + public String paramName() { + return this.paramName; + } + + /** + * Set the paramName property: Parameter name. + * + * @param paramName the paramName value to set. + * @return the UrlSigningParamIdentifier object itself. + */ + public UrlSigningParamIdentifier withParamName(String paramName) { + this.paramName = paramName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (paramIndicator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property paramIndicator in model UrlSigningParamIdentifier")); + } + if (paramName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property paramName in model UrlSigningParamIdentifier")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UrlSigningParamIdentifier.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Usage.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Usage.java new file mode 100644 index 0000000000000..9f80c3a7bdfc9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Usage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the id property: Resource identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + long currentValue(); + + /** + * Gets the limit property: The limit of usage. + * + * @return the limit value. + */ + long limit(); + + /** + * Gets the name property: The name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageName.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageName.java new file mode 100644 index 0000000000000..8a666bceecb51 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageName.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names. */ +@Fluent +public final class UsageName { + /* + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /* + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** Creates an instance of UsageName class. */ + public UsageName() { + } + + /** + * Get the value property: A string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string describing the resource name. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: A localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: A localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.java new file mode 100644 index 0000000000000..96de56f0faa59 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** An enum describing the unit of measurement. */ +public final class UsageUnit extends ExpandableStringEnum { + /** Static value Count for UsageUnit. */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + @JsonCreator + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** + * Gets known UsageUnit values. + * + * @return known UsageUnit values. + */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java new file mode 100644 index 0000000000000..6cab0e8963cee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list usages operation response. */ +@Fluent +public final class UsagesListResult { + /* + * The list of resource usages. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of UsagesListResult class. */ + public UsagesListResult() { + } + + /** + * Get the value property: The list of resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of resource usages. + * + * @param value the value value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..ce38733f8c0cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.java new file mode 100644 index 0000000000000..0466124117227 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the certificate source parameters using user's keyvault certificate for enabling SSL. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "certificateSource") +@JsonTypeName("AzureKeyVault") +@Fluent +public final class UserManagedHttpsParameters extends CustomDomainHttpsParameters { + /* + * Defines the certificate source parameters using user's keyvault certificate for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private KeyVaultCertificateSourceParameters certificateSourceParameters; + + /** Creates an instance of UserManagedHttpsParameters class. */ + public UserManagedHttpsParameters() { + } + + /** + * Get the certificateSourceParameters property: Defines the certificate source parameters using user's keyvault + * certificate for enabling SSL. + * + * @return the certificateSourceParameters value. + */ + public KeyVaultCertificateSourceParameters certificateSourceParameters() { + return this.certificateSourceParameters; + } + + /** + * Set the certificateSourceParameters property: Defines the certificate source parameters using user's keyvault + * certificate for enabling SSL. + * + * @param certificateSourceParameters the certificateSourceParameters value to set. + * @return the UserManagedHttpsParameters object itself. + */ + public UserManagedHttpsParameters withCertificateSourceParameters( + KeyVaultCertificateSourceParameters certificateSourceParameters) { + this.certificateSourceParameters = certificateSourceParameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public UserManagedHttpsParameters withProtocolType(ProtocolType protocolType) { + super.withProtocolType(protocolType); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserManagedHttpsParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + super.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (certificateSourceParameters() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateSourceParameters in model UserManagedHttpsParameters")); + } else { + certificateSourceParameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserManagedHttpsParameters.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.java new file mode 100644 index 0000000000000..ed8e25295e5cd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the custom domain to be validated for DNS mapping. */ +@Fluent +public final class ValidateCustomDomainInput { + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /** Creates an instance of ValidateCustomDomainInput class. */ + public ValidateCustomDomainInput() { + } + + /** + * Get the hostname property: The host name of the custom domain. Must be a domain name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name of the custom domain. Must be a domain name. + * + * @param hostname the hostname value to set. + * @return the ValidateCustomDomainInput object itself. + */ + public ValidateCustomDomainInput withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model ValidateCustomDomainInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateCustomDomainInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainOutput.java new file mode 100644 index 0000000000000..0e67bc254c998 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainOutput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner; + +/** An immutable client-side representation of ValidateCustomDomainOutput. */ +public interface ValidateCustomDomainOutput { + /** + * Gets the customDomainValidated property: Indicates whether the custom domain is valid or not. + * + * @return the customDomainValidated value. + */ + Boolean customDomainValidated(); + + /** + * Gets the reason property: The reason why the custom domain is not valid. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: Error message describing why the custom domain is not valid. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ValidateCustomDomainOutputInner object. + * + * @return the inner object. + */ + ValidateCustomDomainOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.java new file mode 100644 index 0000000000000..50f7647ca55c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the validate probe API. */ +@Fluent +public final class ValidateProbeInput { + /* + * The probe URL to validate. + */ + @JsonProperty(value = "probeURL", required = true) + private String probeUrl; + + /** Creates an instance of ValidateProbeInput class. */ + public ValidateProbeInput() { + } + + /** + * Get the probeUrl property: The probe URL to validate. + * + * @return the probeUrl value. + */ + public String probeUrl() { + return this.probeUrl; + } + + /** + * Set the probeUrl property: The probe URL to validate. + * + * @param probeUrl the probeUrl value to set. + * @return the ValidateProbeInput object itself. + */ + public ValidateProbeInput withProbeUrl(String probeUrl) { + this.probeUrl = probeUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (probeUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property probeUrl in model ValidateProbeInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateProbeInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeOutput.java new file mode 100644 index 0000000000000..8b4765bd12c24 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeOutput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; + +/** An immutable client-side representation of ValidateProbeOutput. */ +public interface ValidateProbeOutput { + /** + * Gets the isValid property: Indicates whether the probe URL is accepted or not. + * + * @return the isValid value. + */ + Boolean isValid(); + + /** + * Gets the errorCode property: Specifies the error code when the probe url is not accepted. + * + * @return the errorCode value. + */ + String errorCode(); + + /** + * Gets the message property: The detailed error message describing why the probe URL is not accepted. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner object. + * + * @return the inner object. + */ + ValidateProbeOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.java new file mode 100644 index 0000000000000..0684b15c5e46a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the secret to be validated. */ +@Fluent +public final class ValidateSecretInput { + /* + * The secret type. + */ + @JsonProperty(value = "secretType", required = true) + private SecretType secretType; + + /* + * Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * Secret version, if customer is using a specific version. + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /** Creates an instance of ValidateSecretInput class. */ + public ValidateSecretInput() { + } + + /** + * Get the secretType property: The secret type. + * + * @return the secretType value. + */ + public SecretType secretType() { + return this.secretType; + } + + /** + * Set the secretType property: The secret type. + * + * @param secretType the secretType value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretType(SecretType secretType) { + this.secretType = secretType; + return this; + } + + /** + * Get the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the Azure Key Vault secret. Expected to be in format of + * /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + * + * @param secretSource the secretSource value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretVersion property: Secret version, if customer is using a specific version. + * + * @return the secretVersion value. + */ + public String secretVersion() { + return this.secretVersion; + } + + /** + * Set the secretVersion property: Secret version, if customer is using a specific version. + * + * @param secretVersion the secretVersion value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretVersion(String secretVersion) { + this.secretVersion = secretVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property secretType in model ValidateSecretInput")); + } + if (secretSource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretSource in model ValidateSecretInput")); + } else { + secretSource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateSecretInput.class); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretOutput.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretOutput.java new file mode 100644 index 0000000000000..96414a0c69445 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretOutput.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; + +/** An immutable client-side representation of ValidateSecretOutput. */ +public interface ValidateSecretOutput { + /** + * Gets the status property: The validation status. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the message property: Detailed error message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner object. + * + * @return the inner object. + */ + ValidateSecretOutputInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java new file mode 100644 index 0000000000000..f0ec02fb4b3ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafAction. */ +public final class WafAction extends ExpandableStringEnum { + /** Static value allow for WafAction. */ + public static final WafAction ALLOW = fromString("allow"); + + /** Static value block for WafAction. */ + public static final WafAction BLOCK = fromString("block"); + + /** Static value log for WafAction. */ + public static final WafAction LOG = fromString("log"); + + /** Static value redirect for WafAction. */ + public static final WafAction REDIRECT = fromString("redirect"); + + /** + * Creates or finds a WafAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafAction. + */ + @JsonCreator + public static WafAction fromString(String name) { + return fromString(name, WafAction.class); + } + + /** + * Gets known WafAction values. + * + * @return known WafAction values. + */ + public static Collection values() { + return values(WafAction.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java new file mode 100644 index 0000000000000..5dc79760358ac --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafGranularity. */ +public final class WafGranularity extends ExpandableStringEnum { + /** Static value PT5M for WafGranularity. */ + public static final WafGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for WafGranularity. */ + public static final WafGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for WafGranularity. */ + public static final WafGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a WafGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafGranularity. + */ + @JsonCreator + public static WafGranularity fromString(String name) { + return fromString(name, WafGranularity.class); + } + + /** + * Gets known WafGranularity values. + * + * @return known WafGranularity values. + */ + public static Collection values() { + return values(WafGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.java new file mode 100644 index 0000000000000..180d2cebc763d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMatchVariable.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Match variable to compare against. */ +public final class WafMatchVariable extends ExpandableStringEnum { + /** Static value RemoteAddr for WafMatchVariable. */ + public static final WafMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value SocketAddr for WafMatchVariable. */ + public static final WafMatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** Static value RequestMethod for WafMatchVariable. */ + public static final WafMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value RequestHeader for WafMatchVariable. */ + public static final WafMatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** Static value RequestUri for WafMatchVariable. */ + public static final WafMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value QueryString for WafMatchVariable. */ + public static final WafMatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value RequestBody for WafMatchVariable. */ + public static final WafMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value Cookies for WafMatchVariable. */ + public static final WafMatchVariable COOKIES = fromString("Cookies"); + + /** Static value PostArgs for WafMatchVariable. */ + public static final WafMatchVariable POST_ARGS = fromString("PostArgs"); + + /** + * Creates or finds a WafMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMatchVariable. + */ + @JsonCreator + public static WafMatchVariable fromString(String name) { + return fromString(name, WafMatchVariable.class); + } + + /** + * Gets known WafMatchVariable values. + * + * @return known WafMatchVariable values. + */ + public static Collection values() { + return values(WafMatchVariable.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.java new file mode 100644 index 0000000000000..a52cbec48b955 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafMetric. */ +public final class WafMetric extends ExpandableStringEnum { + /** Static value clientRequestCount for WafMetric. */ + public static final WafMetric CLIENT_REQUEST_COUNT = fromString("clientRequestCount"); + + /** + * Creates or finds a WafMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetric. + */ + @JsonCreator + public static WafMetric fromString(String name) { + return fromString(name, WafMetric.class); + } + + /** + * Gets known WafMetric values. + * + * @return known WafMetric values. + */ + public static Collection values() { + return values(WafMetric.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.java new file mode 100644 index 0000000000000..0106428580103 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsGranularity.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafMetricsGranularity. */ +public final class WafMetricsGranularity extends ExpandableStringEnum { + /** Static value PT5M for WafMetricsGranularity. */ + public static final WafMetricsGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for WafMetricsGranularity. */ + public static final WafMetricsGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for WafMetricsGranularity. */ + public static final WafMetricsGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a WafMetricsGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetricsGranularity. + */ + @JsonCreator + public static WafMetricsGranularity fromString(String name) { + return fromString(name, WafMetricsGranularity.class); + } + + /** + * Gets known WafMetricsGranularity values. + * + * @return known WafMetricsGranularity values. + */ + public static Collection values() { + return values(WafMetricsGranularity.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java new file mode 100644 index 0000000000000..bbb16ba661068 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of WafMetricsResponse. */ +public interface WafMetricsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the granularity property: The granularity property. + * + * @return the granularity value. + */ + WafMetricsGranularity granularity(); + + /** + * Gets the series property: The series property. + * + * @return the series value. + */ + List series(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner object. + * + * @return the inner object. + */ + WafMetricsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java new file mode 100644 index 0000000000000..18cdaaac54637 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The WafMetricsResponseSeriesItem model. */ +@Fluent +public final class WafMetricsResponseSeriesItem { + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private WafMetricsSeriesUnit unit; + + /* + * The groups property. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** Creates an instance of WafMetricsResponseSeriesItem class. */ + public WafMetricsResponseSeriesItem() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public WafMetricsSeriesUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withUnit(WafMetricsSeriesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the groups property: The groups property. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The groups property. + * + * @param groups the groups value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public List data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the WafMetricsResponseSeriesItem object itself. + */ + public WafMetricsResponseSeriesItem withData(List data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (data() != null) { + data().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java new file mode 100644 index 0000000000000..dc856d08121c8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemData.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The WafMetricsResponseSeriesItemData model. */ +@Fluent +public final class WafMetricsResponseSeriesItemData { + /* + * The dateTime property. + */ + @JsonProperty(value = "dateTime") + private OffsetDateTime dateTime; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Float value; + + /** Creates an instance of WafMetricsResponseSeriesItemData class. */ + public WafMetricsResponseSeriesItemData() { + } + + /** + * Get the dateTime property: The dateTime property. + * + * @return the dateTime value. + */ + public OffsetDateTime dateTime() { + return this.dateTime; + } + + /** + * Set the dateTime property: The dateTime property. + * + * @param dateTime the dateTime value to set. + * @return the WafMetricsResponseSeriesItemData object itself. + */ + public WafMetricsResponseSeriesItemData withDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafMetricsResponseSeriesItemData object itself. + */ + public WafMetricsResponseSeriesItemData withValue(Float 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesPropertiesItemsItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesPropertiesItemsItem.java new file mode 100644 index 0000000000000..d03fc5606010f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesPropertiesItemsItem.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WafMetricsResponseSeriesPropertiesItemsItem model. */ +@Fluent +public final class WafMetricsResponseSeriesPropertiesItemsItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of WafMetricsResponseSeriesPropertiesItemsItem class. */ + public WafMetricsResponseSeriesPropertiesItemsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the WafMetricsResponseSeriesPropertiesItemsItem object itself. + */ + public WafMetricsResponseSeriesPropertiesItemsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafMetricsResponseSeriesPropertiesItemsItem object itself. + */ + public WafMetricsResponseSeriesPropertiesItemsItem 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/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.java new file mode 100644 index 0000000000000..88de253c65ae7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsSeriesUnit.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafMetricsSeriesUnit. */ +public final class WafMetricsSeriesUnit extends ExpandableStringEnum { + /** Static value count for WafMetricsSeriesUnit. */ + public static final WafMetricsSeriesUnit COUNT = fromString("count"); + + /** + * Creates or finds a WafMetricsSeriesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetricsSeriesUnit. + */ + @JsonCreator + public static WafMetricsSeriesUnit fromString(String name) { + return fromString(name, WafMetricsSeriesUnit.class); + } + + /** + * Gets known WafMetricsSeriesUnit values. + * + * @return known WafMetricsSeriesUnit values. + */ + public static Collection values() { + return values(WafMetricsSeriesUnit.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java new file mode 100644 index 0000000000000..a4a73aad0d465 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafRankingGroupBy. */ +public final class WafRankingGroupBy extends ExpandableStringEnum { + /** Static value httpStatusCode for WafRankingGroupBy. */ + public static final WafRankingGroupBy HTTP_STATUS_CODE = fromString("httpStatusCode"); + + /** Static value customDomain for WafRankingGroupBy. */ + public static final WafRankingGroupBy CUSTOM_DOMAIN = fromString("customDomain"); + + /** + * Creates or finds a WafRankingGroupBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRankingGroupBy. + */ + @JsonCreator + public static WafRankingGroupBy fromString(String name) { + return fromString(name, WafRankingGroupBy.class); + } + + /** + * Gets known WafRankingGroupBy values. + * + * @return known WafRankingGroupBy values. + */ + public static Collection values() { + return values(WafRankingGroupBy.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java new file mode 100644 index 0000000000000..272760599a413 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafRankingType. */ +public final class WafRankingType extends ExpandableStringEnum { + /** Static value action for WafRankingType. */ + public static final WafRankingType ACTION = fromString("action"); + + /** Static value ruleGroup for WafRankingType. */ + public static final WafRankingType RULE_GROUP = fromString("ruleGroup"); + + /** Static value ruleId for WafRankingType. */ + public static final WafRankingType RULE_ID = fromString("ruleId"); + + /** Static value userAgent for WafRankingType. */ + public static final WafRankingType USER_AGENT = fromString("userAgent"); + + /** Static value clientIp for WafRankingType. */ + public static final WafRankingType CLIENT_IP = fromString("clientIp"); + + /** Static value url for WafRankingType. */ + public static final WafRankingType URL = fromString("url"); + + /** Static value countryOrRegion for WafRankingType. */ + public static final WafRankingType COUNTRY_OR_REGION = fromString("countryOrRegion"); + + /** Static value ruleType for WafRankingType. */ + public static final WafRankingType RULE_TYPE = fromString("ruleType"); + + /** + * Creates or finds a WafRankingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRankingType. + */ + @JsonCreator + public static WafRankingType fromString(String name) { + return fromString(name, WafRankingType.class); + } + + /** + * Gets known WafRankingType values. + * + * @return known WafRankingType values. + */ + public static Collection values() { + return values(WafRankingType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java new file mode 100644 index 0000000000000..a53be01f7ee34 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of WafRankingsResponse. */ +public interface WafRankingsResponse { + /** + * Gets the dateTimeBegin property: The dateTimeBegin property. + * + * @return the dateTimeBegin value. + */ + OffsetDateTime dateTimeBegin(); + + /** + * Gets the dateTimeEnd property: The dateTimeEnd property. + * + * @return the dateTimeEnd value. + */ + OffsetDateTime dateTimeEnd(); + + /** + * Gets the groups property: The groups property. + * + * @return the groups value. + */ + List groups(); + + /** + * Gets the data property: The data property. + * + * @return the data value. + */ + List data(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.WafRankingsResponseInner object. + * + * @return the inner object. + */ + WafRankingsResponseInner innerModel(); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.java new file mode 100644 index 0000000000000..f4765b3687150 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The WafRankingsResponseDataItem model. */ +@Fluent +public final class WafRankingsResponseDataItem { + /* + * The groupValues property. + */ + @JsonProperty(value = "groupValues") + private List groupValues; + + /* + * The metrics property. + */ + @JsonProperty(value = "metrics") + private List metrics; + + /** Creates an instance of WafRankingsResponseDataItem class. */ + public WafRankingsResponseDataItem() { + } + + /** + * Get the groupValues property: The groupValues property. + * + * @return the groupValues value. + */ + public List groupValues() { + return this.groupValues; + } + + /** + * Set the groupValues property: The groupValues property. + * + * @param groupValues the groupValues value to set. + * @return the WafRankingsResponseDataItem object itself. + */ + public WafRankingsResponseDataItem withGroupValues(List groupValues) { + this.groupValues = groupValues; + return this; + } + + /** + * Get the metrics property: The metrics property. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: The metrics property. + * + * @param metrics the metrics value to set. + * @return the WafRankingsResponseDataItem object itself. + */ + public WafRankingsResponseDataItem withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.java new file mode 100644 index 0000000000000..2977232bbf5b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItemMetric.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.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WafRankingsResponseDataItemMetric model. */ +@Fluent +public final class WafRankingsResponseDataItemMetric { + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Long value; + + /* + * The percentage property. + */ + @JsonProperty(value = "percentage") + private Double percentage; + + /** Creates an instance of WafRankingsResponseDataItemMetric class. */ + public WafRankingsResponseDataItemMetric() { + } + + /** + * Get the metric property: The metric property. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: The metric property. + * + * @param metric the metric value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public Long value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withValue(Long value) { + this.value = value; + return this; + } + + /** + * Get the percentage property: The percentage property. + * + * @return the percentage value. + */ + public Double percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage property. + * + * @param percentage the percentage value to set. + * @return the WafRankingsResponseDataItemMetric object itself. + */ + public WafRankingsResponseDataItemMetric withPercentage(Double percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.java new file mode 100644 index 0000000000000..dd31d477320f2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.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.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafRuleType. */ +public final class WafRuleType extends ExpandableStringEnum { + /** Static value managed for WafRuleType. */ + public static final WafRuleType MANAGED = fromString("managed"); + + /** Static value custom for WafRuleType. */ + public static final WafRuleType CUSTOM = fromString("custom"); + + /** Static value bot for WafRuleType. */ + public static final WafRuleType BOT = fromString("bot"); + + /** + * Creates or finds a WafRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafRuleType. + */ + @JsonCreator + public static WafRuleType fromString(String name) { + return fromString(name, WafRuleType.class); + } + + /** + * Gets known WafRuleType values. + * + * @return known WafRuleType values. + */ + public static Collection values() { + return values(WafRuleType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java new file mode 100644 index 0000000000000..e4670bbd79ce2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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 CdnManagementClient. Cdn Management Client. */ +package com.azure.resourcemanager.cdn.generated.models; diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/package-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/package-info.java new file mode 100644 index 0000000000000..0c84ae4038b47 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/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 CdnManagementClient. Cdn Management Client. */ +package com.azure.resourcemanager.cdn.generated; diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/module-info.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..df1998082b27a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-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.cdn.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.cdn.generated; + exports com.azure.resourcemanager.cdn.generated.fluent; + exports com.azure.resourcemanager.cdn.generated.fluent.models; + exports com.azure.resourcemanager.cdn.generated.models; + + opens com.azure.resourcemanager.cdn.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.cdn.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.java new file mode 100644 index 0000000000000..91c7d7d0c7a8e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsCreateSamples.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.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for AfdCustomDomains Create. */ +public final class AfdCustomDomainsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Create.json + */ + /** + * Sample code: AFDCustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdCustomDomains() + .define("domain1") + .withExistingProfile("RG", "profile1") + .withHostname("www.someDomain.net") + .withTlsSettings( + new AfdDomainHttpsParameters() + .withCertificateType(AfdCertificateType.MANAGED_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java new file mode 100644 index 0000000000000..47e05ebef94a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains Delete. */ +public final class AfdCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Delete.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().delete("RG", "profile1", "domain1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java new file mode 100644 index 0000000000000..34e93d137dd55 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains Get. */ +public final class AfdCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Get.json + */ + /** + * Sample code: AFDCustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java new file mode 100644 index 0000000000000..55d377aa77560 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains ListByProfile. */ +public final class AfdCustomDomainsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_ListByProfile.json + */ + /** + * Sample code: AFDCustomDomains_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java new file mode 100644 index 0000000000000..2ae7cbd7bd63b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsRefreshValidationTokenSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdCustomDomains RefreshValidationToken. */ +public final class AfdCustomDomainsRefreshValidationTokenSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_RefreshValidationToken.json + */ + /** + * Sample code: AFDCustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdCustomDomains().refreshValidationToken("RG", "profile1", "domain1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java new file mode 100644 index 0000000000000..07549aa3cdb3b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdCustomDomainsUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdCertificateType; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.AfdDomainHttpsParameters; +import com.azure.resourcemanager.cdn.generated.models.AfdMinimumTlsVersion; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for AfdCustomDomains Update. */ +public final class AfdCustomDomainsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDCustomDomains_Update.json + */ + /** + * Sample code: AFDCustomDomains_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDCustomDomainsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdDomain resource = + manager.afdCustomDomains().getWithResponse("RG", "profile1", "domain1", Context.NONE).getValue(); + resource + .update() + .withTlsSettings( + new AfdDomainHttpsParameters() + .withCertificateType(AfdCertificateType.CUSTOMER_CERTIFICATE) + .withMinimumTlsVersion(AfdMinimumTlsVersion.TLS12)) + .withAzureDnsZone(new ResourceReference().withId("")) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java new file mode 100644 index 0000000000000..ae3d563e08c6e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** Samples for AfdEndpoints Create. */ +public final class AfdEndpointsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Create.json + */ + /** + * Sample code: AFDEndpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java new file mode 100644 index 0000000000000..d2c224f61237d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints Delete. */ +public final class AfdEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Delete.json + */ + /** + * Sample code: AFDEndpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().delete("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java new file mode 100644 index 0000000000000..d3eeed1656f16 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints Get. */ +public final class AfdEndpointsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Get.json + */ + /** + * Sample code: AFDEndpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java new file mode 100644 index 0000000000000..5c4d1991deeb9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints ListByProfile. */ +public final class AfdEndpointsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ListByProfile.json + */ + /** + * Sample code: AFDEndpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java new file mode 100644 index 0000000000000..282b07c0c897f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdEndpoints ListResourceUsage. */ +public final class AfdEndpointsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ListResourceUsage.json + */ + /** + * Sample code: AFDEndpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdEndpoints().listResourceUsage("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java new file mode 100644 index 0000000000000..a49447f0316b1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsPurgeContentSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdPurgeParameters; +import java.util.Arrays; + +/** Samples for AfdEndpoints PurgeContent. */ +public final class AfdEndpointsPurgeContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_PurgeContent.json + */ + /** + * Sample code: AFDEndpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .purgeContent( + "RG", + "profile1", + "endpoint1", + new AfdPurgeParameters() + .withContentPaths(Arrays.asList("/folder1")) + .withDomains(Arrays.asList("endpoint1-abcdefghijklmnop.z01.azurefd.net")), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java new file mode 100644 index 0000000000000..5b2cfa968cad7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpoint; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AfdEndpoints Update. */ +public final class AfdEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_Update.json + */ + /** + * Sample code: AFDEndpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDEndpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdEndpoint resource = + manager.afdEndpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE).getValue(); + resource.update().withTags(mapOf()).withEnabledState(EnabledState.ENABLED).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/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java new file mode 100644 index 0000000000000..69db8a9967554 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdEndpointsValidateCustomDomainSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** Samples for AfdEndpoints ValidateCustomDomain. */ +public final class AfdEndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDEndpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdEndpoints() + .validateCustomDomainWithResponse( + "RG", + "profile1", + "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.java new file mode 100644 index 0000000000000..0867c7335dd84 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsCreateSamples.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.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** Samples for AfdOriginGroups Create. */ +public final class AfdOriginGroupsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Create.json + */ + /** + * Sample code: AFDOriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdOriginGroups() + .define("origingroup1") + .withExistingProfile("RG", "profile1") + .withLoadBalancingSettings( + new LoadBalancingSettingsParameters() + .withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java new file mode 100644 index 0000000000000..aa7ef3502a088 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups Delete. */ +public final class AfdOriginGroupsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Delete.json + */ + /** + * Sample code: AFDOriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().delete("RG", "profile1", "origingroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java new file mode 100644 index 0000000000000..716b94d9ebf24 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups Get. */ +public final class AfdOriginGroupsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Get.json + */ + /** + * Sample code: AFDOriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java new file mode 100644 index 0000000000000..48eb32e2f6fe1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups ListByProfile. */ +public final class AfdOriginGroupsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_ListByProfile.json + */ + /** + * Sample code: AFDOriginGroups_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java new file mode 100644 index 0000000000000..4f09132bf009e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOriginGroups ListResourceUsage. */ +public final class AfdOriginGroupsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_ListResourceUsage.json + */ + /** + * Sample code: AFDOriginGroups_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOriginGroups().listResourceUsage("RG", "profile1", "origingroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java new file mode 100644 index 0000000000000..b4eeb202376e3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginGroupsUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdOriginGroup; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.LoadBalancingSettingsParameters; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; + +/** Samples for AfdOriginGroups Update. */ +public final class AfdOriginGroupsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOriginGroups_Update.json + */ + /** + * Sample code: AFDOriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOriginGroup resource = + manager.afdOriginGroups().getWithResponse("RG", "profile1", "origingroup1", Context.NONE).getValue(); + resource + .update() + .withLoadBalancingSettings( + new LoadBalancingSettingsParameters() + .withSampleSize(3) + .withSuccessfulSamplesRequired(3) + .withAdditionalLatencyInMilliseconds(1000)) + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/path2") + .withProbeRequestType(HealthProbeRequestType.NOT_SET) + .withProbeProtocol(ProbeProtocol.NOT_SET) + .withProbeIntervalInSeconds(10)) + .withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes(5) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java new file mode 100644 index 0000000000000..f5da944a8c330 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsCreateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** Samples for AfdOrigins Create. */ +public final class AfdOriginsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Create.json + */ + /** + * Sample code: AFDOrigins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdOrigins() + .define("origin1") + .withExistingOriginGroup("RG", "profile1", "origingroup1") + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("host1.foo.com") + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java new file mode 100644 index 0000000000000..41d63ab889d40 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOrigins Delete. */ +public final class AfdOriginsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Delete.json + */ + /** + * Sample code: AFDOrigins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().delete("RG", "profile1", "origingroup1", "origin1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java new file mode 100644 index 0000000000000..f7a043f916f88 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOrigins Get. */ +public final class AfdOriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Get.json + */ + /** + * Sample code: AFDOrigins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().getWithResponse("RG", "profile1", "origingroup1", "origin1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java new file mode 100644 index 0000000000000..983a32b2fe304 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsListByOriginGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdOrigins ListByOriginGroup. */ +public final class AfdOriginsListByOriginGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_ListByOriginGroup.json + */ + /** + * Sample code: AFDOrigins_ListByOriginGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsListByOriginGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdOrigins().listByOriginGroup("RG", "profile1", "origingroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java new file mode 100644 index 0000000000000..cd574def3420c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdOriginsUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AfdOrigin; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; + +/** Samples for AfdOrigins Update. */ +public final class AfdOriginsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDOrigins_Update.json + */ + /** + * Sample code: AFDOrigins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDOriginsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + AfdOrigin resource = + manager.afdOrigins().getWithResponse("RG", "profile1", "origingroup1", "origin1", Context.NONE).getValue(); + resource + .update() + .withHostname("host1.blob.core.windows.net") + .withHttpPort(80) + .withHttpsPort(443) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java new file mode 100644 index 0000000000000..8008411bd2130 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesCheckHostnameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckHostnameAvailabilityInput; + +/** Samples for AfdProfiles CheckHostnameAvailability. */ +public final class AfdProfilesCheckHostnameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_CheckHostNameAvailability.json + */ + /** + * Sample code: AFDProfiles_CheckHostNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesCheckHostNameAvailability( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .checkHostnameAvailabilityWithResponse( + "RG", + "profile1", + new CheckHostnameAvailabilityInput().withHostname("www.someDomain.net"), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java new file mode 100644 index 0000000000000..b8aed13b9e490 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AfdProfiles ListResourceUsage. */ +public final class AfdProfilesListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_ListResourceUsage.json + */ + /** + * Sample code: AFDProfiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.afdProfiles().listResourceUsage("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.java new file mode 100644 index 0000000000000..6ee53250132c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesUpgradeSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ProfileChangeSkuWafMapping; +import com.azure.resourcemanager.cdn.generated.models.ProfileUpgradeParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for AfdProfiles Upgrade. */ +public final class AfdProfilesUpgradeSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_Upgrade.json + */ + /** + * Sample code: AFDProfiles_Upgrade. + * + * @param manager Entry point to CdnManager. + */ + public static void aFDProfilesUpgrade(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .upgrade( + "RG", + "profile1", + new ProfileUpgradeParameters() + .withWafMappingList( + Arrays + .asList( + new ProfileChangeSkuWafMapping() + .withSecurityPolicyName("securityPolicy1") + .withChangeToWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2")))), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java new file mode 100644 index 0000000000000..d82f4d842dca0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/AfdProfilesValidateSecretSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecretType; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** Samples for AfdProfiles ValidateSecret. */ +public final class AfdProfilesValidateSecretSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/AFDProfiles_ValidateSecret.json + */ + /** + * Sample code: Validate_Secret. + * + * @param manager Entry point to CdnManager. + */ + public static void validateSecret(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .afdProfiles() + .validateSecretWithResponse( + "RG", + "profile1", + new ValidateSecretInput() + .withSecretType(SecretType.CUSTOMER_CERTIFICATE) + .withSecretSource( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName")), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java new file mode 100644 index 0000000000000..dc73438d6b05c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** Samples for CustomDomains Create. */ +public final class CustomDomainsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Create.json + */ + /** + * Sample code: CustomDomains_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java new file mode 100644 index 0000000000000..e070d1f1a7cf8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().delete("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java new file mode 100644 index 0000000000000..b30a88cf54b95 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsDisableCustomHttpsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains DisableCustomHttps. */ +public final class CustomDomainsDisableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_DisableCustomHttps.json + */ + /** + * Sample code: CustomDomains_DisableCustomHttps. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsDisableCustomHttps(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().disableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.java new file mode 100644 index 0000000000000..52473cb119aff --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsEnableCustomHttpsSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains EnableCustomHttps. */ +public final class CustomDomainsEnableCustomHttpsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingCDNManagedCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json + */ + /** + * Sample code: CustomDomains_EnableCustomHttpsUsingYourOwnCertificate. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsEnableCustomHttpsUsingYourOwnCertificate( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .customDomains() + .enableCustomHttps("RG", "profile1", "endpoint1", "www-someDomain-net", null, Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java new file mode 100644 index 0000000000000..b8088f6aa8637 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java new file mode 100644 index 0000000000000..f2cd7514bf460 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/CustomDomainsListByEndpointSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains ListByEndpoint. */ +public final class CustomDomainsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CustomDomains_ListByEndpoint.json + */ + /** + * Sample code: CustomDomains_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void customDomainsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.customDomains().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java new file mode 100644 index 0000000000000..17bddcf9efe3e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EdgeNodesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for EdgeNodes List. */ +public final class EdgeNodesListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/EdgeNodes_List.json + */ + /** + * Sample code: EdgeNodes_List. + * + * @param manager Entry point to CdnManager. + */ + public static void edgeNodesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.edgeNodes().list(Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java new file mode 100644 index 0000000000000..07f25f0ffca65 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +/** Samples for Endpoints Create. */ +public final class EndpointsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Create.json + */ + /** + * Sample code: Endpoints_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .define("endpoint1") + .withRegion((String) null) + .withExistingProfile("RG", "profile1") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java new file mode 100644 index 0000000000000..2e42ecd05deb5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints Delete. */ +public final class EndpointsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Delete.json + */ + /** + * Sample code: Endpoints_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().delete("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java new file mode 100644 index 0000000000000..88f94d1c69bdc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints Get. */ +public final class EndpointsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Get.json + */ + /** + * Sample code: Endpoints_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java new file mode 100644 index 0000000000000..53fdf45e2e8f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints ListByProfile. */ +public final class EndpointsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ListByProfile.json + */ + /** + * Sample code: Endpoints_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java new file mode 100644 index 0000000000000..7dc8babe476d7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints ListResourceUsage. */ +public final class EndpointsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ListResourceUsage.json + */ + /** + * Sample code: Endpoints_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().listResourceUsage("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java new file mode 100644 index 0000000000000..a4d8c5323d7f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsLoadContentSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LoadParameters; +import java.util.Arrays; + +/** Samples for Endpoints LoadContent. */ +public final class EndpointsLoadContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_LoadContent.json + */ + /** + * Sample code: Endpoints_LoadContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsLoadContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .loadContent( + "RG", + "profile1", + "endpoint1", + new LoadParameters().withContentPaths(Arrays.asList("/folder1")), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java new file mode 100644 index 0000000000000..d680e5eb2b8d0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsPurgeContentSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.PurgeParameters; +import java.util.Arrays; + +/** Samples for Endpoints PurgeContent. */ +public final class EndpointsPurgeContentSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_PurgeContent.json + */ + /** + * Sample code: Endpoints_PurgeContent. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsPurgeContent(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .purgeContent( + "RG", + "profile1", + "endpoint1", + new PurgeParameters().withContentPaths(Arrays.asList("/folder1")), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java new file mode 100644 index 0000000000000..a8ddc557ab35e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints Start. */ +public final class EndpointsStartSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Start.json + */ + /** + * Sample code: Endpoints_Start. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStart(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().start("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java new file mode 100644 index 0000000000000..290803f725a42 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsStopSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Endpoints Stop. */ +public final class EndpointsStopSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Stop.json + */ + /** + * Sample code: Endpoints_Stop. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsStop(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.endpoints().stop("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.java new file mode 100644 index 0000000000000..71d2dc47de7fd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsUpdateSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Endpoint; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Endpoints Update. */ +public final class EndpointsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_Update.json + */ + /** + * Sample code: Endpoints_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Endpoint resource = manager.endpoints().getWithResponse("RG", "profile1", "endpoint1", Context.NONE).getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).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/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java new file mode 100644 index 0000000000000..afc4c051a2285 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/EndpointsValidateCustomDomainSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; + +/** Samples for Endpoints ValidateCustomDomain. */ +public final class EndpointsValidateCustomDomainSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Endpoints_ValidateCustomDomain.json + */ + /** + * Sample code: Endpoints_ValidateCustomDomain. + * + * @param manager Entry point to CdnManager. + */ + public static void endpointsValidateCustomDomain(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .endpoints() + .validateCustomDomainWithResponse( + "RG", + "profile1", + "endpoint1", + new ValidateCustomDomainInput().withHostname("www.someDomain.com"), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java new file mode 100644 index 0000000000000..13889564ea299 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsLocationsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LogAnalytics GetLogAnalyticsLocations. */ +public final class LogAnalyticsGetLogAnalyticsLocationsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsLocations.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsLocations. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsLocations( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsLocationsWithResponse("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.java new file mode 100644 index 0000000000000..3771fe983fbdc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsMetricsSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LogMetric; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGranularity; +import com.azure.resourcemanager.cdn.generated.models.LogMetricsGroupBy; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetLogAnalyticsMetrics. */ +public final class LogAnalyticsGetLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsMetrics(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getLogAnalyticsMetricsWithResponse( + "RG", + "profile1", + Arrays.asList(LogMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T04:30:00.000Z"), + OffsetDateTime.parse("2020-11-04T05:00:00.000Z"), + LogMetricsGranularity.PT5M, + Arrays.asList("customdomain1.azurecdn.net", "customdomain2.azurecdn.net"), + Arrays.asList("https"), + Arrays.asList(LogMetricsGroupBy.PROTOCOL), + null, + null, + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.java new file mode 100644 index 0000000000000..80885f15831bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsRankingsSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.LogRanking; +import com.azure.resourcemanager.cdn.generated.models.LogRankingMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetLogAnalyticsRankings. */ +public final class LogAnalyticsGetLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsRankings(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getLogAnalyticsRankingsWithResponse( + "RG", + "profile1", + Arrays.asList(LogRanking.URL), + Arrays.asList(LogRankingMetric.CLIENT_REQUEST_COUNT), + 5, + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + null, + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java new file mode 100644 index 0000000000000..cfc3ca2571713 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetLogAnalyticsResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LogAnalytics GetLogAnalyticsResources. */ +public final class LogAnalyticsGetLogAnalyticsResourcesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetLogAnalyticsResources.json + */ + /** + * Sample code: LogAnalytics_GetLogAnalyticsResources. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetLogAnalyticsResources( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.logAnalytics().getLogAnalyticsResourcesWithResponse("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.java new file mode 100644 index 0000000000000..183aaf88afab4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsMetricsSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.WafAction; +import com.azure.resourcemanager.cdn.generated.models.WafGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetWafLogAnalyticsMetrics. */ +public final class LogAnalyticsGetWafLogAnalyticsMetricsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetWafLogAnalyticsMetrics.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsMetrics. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetWafLogAnalyticsMetrics( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getWafLogAnalyticsMetricsWithResponse( + "RG", + "profile1", + Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + WafGranularity.PT5M, + Arrays.asList(WafAction.BLOCK, WafAction.LOG), + null, + null, + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java new file mode 100644 index 0000000000000..a4240f273c9cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/LogAnalyticsGetWafLogAnalyticsRankingsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.WafMetric; +import com.azure.resourcemanager.cdn.generated.models.WafRankingType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for LogAnalytics GetWafLogAnalyticsRankings. */ +public final class LogAnalyticsGetWafLogAnalyticsRankingsSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/LogAnalytics_GetWafLogAnalyticsRankings.json + */ + /** + * Sample code: LogAnalytics_GetWafLogAnalyticsRankings. + * + * @param manager Entry point to CdnManager. + */ + public static void logAnalyticsGetWafLogAnalyticsRankings( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .logAnalytics() + .getWafLogAnalyticsRankingsWithResponse( + "RG", + "profile1", + Arrays.asList(WafMetric.CLIENT_REQUEST_COUNT), + OffsetDateTime.parse("2020-11-04T06:49:27.554Z"), + OffsetDateTime.parse("2020-11-04T09:49:27.554Z"), + 5, + Arrays.asList(WafRankingType.RULE_ID), + null, + null, + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java new file mode 100644 index 0000000000000..ba00ff457b808 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ManagedRuleSetsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedRuleSets List. */ +public final class ManagedRuleSetsListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafListManagedRuleSets.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.managedRuleSets().list(Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..0839b22e0018e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to CdnManager. + */ + public static void operationsList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java new file mode 100644 index 0000000000000..b43f215954206 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsCreateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedDetectedErrorTypes; +import com.azure.resourcemanager.cdn.generated.models.ResponseBasedOriginErrorDetectionParameters; +import java.util.Arrays; + +/** Samples for OriginGroups Create. */ +public final class OriginGroupsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Create.json + */ + /** + * Sample code: OriginGroups_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .originGroups() + .define("origingroup1") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"))) + .withResponseBasedOriginErrorDetectionSettings( + new ResponseBasedOriginErrorDetectionParameters() + .withResponseBasedDetectedErrorTypes(ResponseBasedDetectedErrorTypes.TCP_ERRORS_ONLY) + .withResponseBasedFailoverThresholdPercentage(10)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java new file mode 100644 index 0000000000000..88b62a415ca63 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for OriginGroups Delete. */ +public final class OriginGroupsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Delete.json + */ + /** + * Sample code: OriginGroups_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().delete("RG", "profile1", "endpoint1", "originGroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java new file mode 100644 index 0000000000000..9534cc6c0a96b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for OriginGroups Get. */ +public final class OriginGroupsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Get.json + */ + /** + * Sample code: OriginGroups_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().getWithResponse("RG", "profile1", "endpoint1", "originGroup1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java new file mode 100644 index 0000000000000..b41a7eb7b2bb9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsListByEndpointSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for OriginGroups ListByEndpoint. */ +public final class OriginGroupsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_ListByEndpoint.json + */ + /** + * Sample code: OriginsGroups_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGroupsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.originGroups().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java new file mode 100644 index 0000000000000..ba05adf95a113 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginGroupsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeRequestType; +import com.azure.resourcemanager.cdn.generated.models.OriginGroup; +import com.azure.resourcemanager.cdn.generated.models.ProbeProtocol; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for OriginGroups Update. */ +public final class OriginGroupsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/OriginGroups_Update.json + */ + /** + * Sample code: OriginGroups_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originGroupsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + OriginGroup resource = + manager + .originGroups() + .getWithResponse("RG", "profile1", "endpoint1", "originGroup1", Context.NONE) + .getValue(); + resource + .update() + .withHealthProbeSettings( + new HealthProbeParameters() + .withProbePath("/health.aspx") + .withProbeRequestType(HealthProbeRequestType.GET) + .withProbeProtocol(ProbeProtocol.HTTP) + .withProbeIntervalInSeconds(120)) + .withOrigins( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"))) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.java new file mode 100644 index 0000000000000..bb123daef58fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsCreateSamples.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.cdn.generated.generated; + +/** Samples for Origins Create. */ +public final class OriginsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Create.json + */ + /** + * Sample code: Origins_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void originsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .origins() + .define("www-someDomain-net") + .withExistingEndpoint("RG", "profile1", "endpoint1") + .withHostname("www.someDomain.net") + .withHttpPort(80) + .withHttpsPort(443) + .withOriginHostHeader("www.someDomain.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkResourceId( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1") + .withPrivateLinkLocation("eastus") + .withPrivateLinkApprovalMessage("Please approve the connection request for this Private Link") + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java new file mode 100644 index 0000000000000..9d7aecec5d648 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Origins Delete. */ +public final class OriginsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Delete.json + */ + /** + * Sample code: Origins_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void originsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().delete("RG", "profile1", "endpoint1", "origin1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java new file mode 100644 index 0000000000000..7c82320de1d27 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Origins Get. */ +public final class OriginsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Get.json + */ + /** + * Sample code: Origins_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void originsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java new file mode 100644 index 0000000000000..82da6ed5e35e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsListByEndpointSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Origins ListByEndpoint. */ +public final class OriginsListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_ListByEndpoint.json + */ + /** + * Sample code: Origins_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void originsListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.origins().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.java new file mode 100644 index 0000000000000..4951601cbab40 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/OriginsUpdateSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Origin; + +/** Samples for Origins Update. */ +public final class OriginsUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Origins_Update.json + */ + /** + * Sample code: Origins_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void originsUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Origin resource = + manager + .origins() + .getWithResponse("RG", "profile1", "endpoint1", "www-someDomain-net", Context.NONE) + .getValue(); + resource + .update() + .withHttpPort(42) + .withHttpsPort(43) + .withOriginHostHeader("www.someDomain2.net") + .withPriority(1) + .withWeight(50) + .withEnabled(true) + .withPrivateLinkAlias("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice") + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..20e18b452cb6e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesCreateOrUpdateSamples.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActionType; +import com.azure.resourcemanager.cdn.generated.models.CustomRule; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.CustomRuleList; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleSetList; +import com.azure.resourcemanager.cdn.generated.models.MatchCondition; +import com.azure.resourcemanager.cdn.generated.models.Operator; +import com.azure.resourcemanager.cdn.generated.models.PolicySettings; +import com.azure.resourcemanager.cdn.generated.models.PolicySettingsDefaultCustomBlockResponseStatusCode; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRule; +import com.azure.resourcemanager.cdn.generated.models.RateLimitRuleList; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; +import com.azure.resourcemanager.cdn.generated.models.TransformType; +import com.azure.resourcemanager.cdn.generated.models.WafMatchVariable; +import java.util.Arrays; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .policies() + .define("MicrosoftCdnWafPolicy") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.STANDARD_MICROSOFT)) + .withPolicySettings( + new PolicySettings() + .withDefaultRedirectUrl("http://www.bing.com") + .withDefaultCustomBlockResponseStatusCode( + PolicySettingsDefaultCustomBlockResponseStatusCode.TWO_ZERO_ZERO) + .withDefaultCustomBlockResponseBody( + "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==")) + .withRateLimitRules( + new RateLimitRuleList() + .withRules( + Arrays + .asList( + new RateLimitRule() + .withName("RateLimitRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(1) + .withMatchConditions( + Arrays + .asList( + new MatchCondition() + .withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.IPMATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")) + .withTransforms(Arrays.asList()))) + .withAction(ActionType.BLOCK) + .withRateLimitThreshold(1000) + .withRateLimitDurationInMinutes(0)))) + .withCustomRules( + new CustomRuleList() + .withRules( + Arrays + .asList( + new CustomRule() + .withName("CustomRule1") + .withEnabledState(CustomRuleEnabledState.ENABLED) + .withPriority(2) + .withMatchConditions( + Arrays + .asList( + new MatchCondition() + .withMatchVariable(WafMatchVariable.REMOTE_ADDR) + .withOperator(Operator.GEO_MATCH) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("CH")) + .withTransforms(Arrays.asList()), + new MatchCondition() + .withMatchVariable(WafMatchVariable.REQUEST_HEADER) + .withSelector("UserAgent") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("windows")) + .withTransforms(Arrays.asList()), + new MatchCondition() + .withMatchVariable(WafMatchVariable.QUERY_STRING) + .withSelector("search") + .withOperator(Operator.CONTAINS) + .withNegateCondition(false) + .withMatchValue(Arrays.asList("")) + .withTransforms( + Arrays + .asList( + TransformType.URL_DECODE, TransformType.LOWERCASE)))) + .withAction(ActionType.BLOCK)))) + .withManagedRules( + new ManagedRuleSetList() + .withManagedRuleSets( + Arrays + .asList( + new ManagedRuleSet() + .withRuleSetType("DefaultRuleSet") + .withRuleSetVersion("preview-1.0") + .withRuleGroupOverrides( + Arrays + .asList( + new ManagedRuleGroupOverride() + .withRuleGroupName("Group1") + .withRules( + Arrays + .asList( + new ManagedRuleOverride() + .withRuleId("GROUP1-0001") + .withEnabledState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.REDIRECT), + new ManagedRuleOverride() + .withRuleId("GROUP1-0002") + .withEnabledState( + ManagedRuleEnabledState.DISABLED)))))))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java new file mode 100644 index 0000000000000..fc9572e9aa1ae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyDelete.json + */ + /** + * Sample code: Delete protection policy. + * + * @param manager Entry point to CdnManager. + */ + public static void deleteProtectionPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().deleteByResourceGroupWithResponse("rg1", "Policy1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1782432d14d51 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies GetByResourceGroup. */ +public final class PoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPolicyGet.json + */ + /** + * Sample code: Get Policy. + * + * @param manager Entry point to CdnManager. + */ + public static void getPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e5e97f2602cd3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies ListByResourceGroup. */ +public final class PoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafListPolicies.json + */ + /** + * Sample code: List Policies in a Resource Group. + * + * @param manager Entry point to CdnManager. + */ + public static void listPoliciesInAResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.policies().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java new file mode 100644 index 0000000000000..5f511ef9a1fa2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/PoliciesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CdnWebApplicationFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/WafPatchPolicy.json + */ + /** + * Sample code: Creates specific policy. + * + * @param manager Entry point to CdnManager. + */ + public static void createsSpecificPolicy(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + CdnWebApplicationFirewallPolicy resource = + manager.policies().getByResourceGroupWithResponse("rg1", "MicrosoftCdnWafPolicy", Context.NONE).getValue(); + resource.update().withTags(mapOf("foo", "bar")).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/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java new file mode 100644 index 0000000000000..4595b076290fc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCanMigrateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CanMigrateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for Profiles CanMigrate. */ +public final class ProfilesCanMigrateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_CanMigrate.json + */ + /** + * Sample code: Profiles_CanMigrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCanMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .canMigrateWithResponse( + "RG", + new CanMigrateParameters() + .withClassicResourceReference( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java new file mode 100644 index 0000000000000..844fa7203df37 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** Samples for Profiles Create. */ +public final class ProfilesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Create.json + */ + /** + * Sample code: Profiles_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .define("profile1") + .withRegion("global") + .withExistingResourceGroup("RG") + .withSku(new Sku().withName(SkuName.PREMIUM_AZURE_FRONT_DOOR)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java new file mode 100644 index 0000000000000..3fa10c1eb72a9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles Delete. */ +public final class ProfilesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Delete.json + */ + /** + * Sample code: Profiles_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().delete("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java new file mode 100644 index 0000000000000..b346cc1e1259c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGenerateSsoUriSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles GenerateSsoUri. */ +public final class ProfilesGenerateSsoUriSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_GenerateSsoUri.json + */ + /** + * Sample code: Profiles_GenerateSsoUri. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGenerateSsoUri(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().generateSsoUriWithResponse("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f491c8d8501b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles GetByResourceGroup. */ +public final class ProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Get.json + */ + /** + * Sample code: Profiles_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().getByResourceGroupWithResponse("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ba548c83a9178 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles ListByResourceGroup. */ +public final class ProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListByResourceGroup.json + */ + /** + * Sample code: Profiles_ListByResourceGroup. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListByResourceGroup(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listByResourceGroup("RG", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java new file mode 100644 index 0000000000000..5eea1dff42336 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles ListResourceUsage. */ +public final class ProfilesListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListResourceUsage.json + */ + /** + * Sample code: Profiles_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listResourceUsage("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java new file mode 100644 index 0000000000000..f69c421ced62d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles List. */ +public final class ProfilesListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_List.json + */ + /** + * Sample code: Profiles_List. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().list(Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java new file mode 100644 index 0000000000000..af6a42544f4a2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesListSupportedOptimizationTypesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles ListSupportedOptimizationTypes. */ +public final class ProfilesListSupportedOptimizationTypesSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_ListSupportedOptimizationTypes.json + */ + /** + * Sample code: Profiles_ListSupportedOptimizationTypes. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesListSupportedOptimizationTypes( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().listSupportedOptimizationTypesWithResponse("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.java new file mode 100644 index 0000000000000..81df314d3c252 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrateSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.MigrationParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SkuName; + +/** Samples for Profiles Migrate. */ +public final class ProfilesMigrateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Migrate.json + */ + /** + * Sample code: Profiles_Migrate. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .profiles() + .migrate( + "RG", + new MigrationParameters() + .withSku(new Sku().withName(SkuName.STANDARD_AZURE_FRONT_DOOR)) + .withClassicResourceReference( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname")) + .withProfileName("profile1"), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java new file mode 100644 index 0000000000000..15ce8981a1f05 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesMigrationCommitSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Profiles MigrationCommit. */ +public final class ProfilesMigrationCommitSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_MigrationCommit.json + */ + /** + * Sample code: Profiles_MigrationCommit. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesMigrationCommit(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.profiles().migrationCommit("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.java new file mode 100644 index 0000000000000..9b2dbbf2c2ac8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ProfilesUpdateSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.Profile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Profiles Update. */ +public final class ProfilesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Profiles_Update.json + */ + /** + * Sample code: Profiles_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void profilesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Profile resource = manager.profiles().getByResourceGroupWithResponse("RG", "profile1", Context.NONE).getValue(); + resource.update().withTags(mapOf("additionalProperties", "Tag1")).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/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java new file mode 100644 index 0000000000000..2086a00311a11 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckEndpointNameAvailabilitySamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.AutoGeneratedDomainNameLabelScope; +import com.azure.resourcemanager.cdn.generated.models.CheckEndpointNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckEndpointNameAvailability. */ +public final class ResourceProviderCheckEndpointNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckEndpointNameAvailability.json + */ + /** + * Sample code: CheckEndpointNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkEndpointNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkEndpointNameAvailabilityWithResponse( + "myResourceGroup", + new CheckEndpointNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_AFD_ENDPOINTS) + .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..f48f9c9893655 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckNameAvailability. */ +public final class ResourceProviderCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckNameAvailability.json + */ + /** + * Sample code: CheckNameAvailability. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java new file mode 100644 index 0000000000000..562bb97b5dee4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderCheckNameAvailabilityWithSubscriptionSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.cdn.generated.models.ResourceType; + +/** Samples for ResourceProvider CheckNameAvailabilityWithSubscription. */ +public final class ResourceProviderCheckNameAvailabilityWithSubscriptionSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/CheckNameAvailabilityWithSubscription.json + */ + /** + * Sample code: CheckNameAvailabilityWithSubscription. + * + * @param manager Entry point to CdnManager. + */ + public static void checkNameAvailabilityWithSubscription( + com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .checkNameAvailabilityWithSubscriptionWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(ResourceType.MICROSOFT_CDN_PROFILES_ENDPOINTS), + Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.java new file mode 100644 index 0000000000000..aa72aa3198246 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceProviderValidateProbeSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ValidateProbeInput; + +/** Samples for ResourceProvider ValidateProbe. */ +public final class ResourceProviderValidateProbeSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/ValidateProbe.json + */ + /** + * Sample code: ValidateProbe. + * + * @param manager Entry point to CdnManager. + */ + public static void validateProbe(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .resourceProviders() + .validateProbeWithResponse( + new ValidateProbeInput().withProbeUrl("https://www.bing.com/image"), Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java new file mode 100644 index 0000000000000..c78911422fd4e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/ResourceUsageListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceUsage List. */ +public final class ResourceUsageListSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/ResourceUsage_List.json + */ + /** + * Sample code: ResourceUsage_List. + * + * @param manager Entry point to CdnManager. + */ + public static void resourceUsageList(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.resourceUsages().list(Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java new file mode 100644 index 0000000000000..5552e83ad729c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesCreateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import java.util.Arrays; + +/** Samples for Routes Create. */ +public final class RoutesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Create.json + */ + /** + * Sample code: Routes_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void routesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .routes() + .define("route1") + .withExistingAfdEndpoint("RG", "profile1", "endpoint1") + .withCustomDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration( + new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_SPECIFIED_QUERY_STRINGS) + .withQueryParameters("querystring=test") + .withCompressionSettings( + new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java new file mode 100644 index 0000000000000..6ae92ff9dd710 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Routes Delete. */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Delete.json + */ + /** + * Sample code: Routes_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void routesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().delete("RG", "profile1", "endpoint1", "route1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java new file mode 100644 index 0000000000000..c42a2c18b06e7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Routes Get. */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Get.json + */ + /** + * Sample code: Routes_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void routesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java new file mode 100644 index 0000000000000..3bbd2c59971f0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesListByEndpointSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Routes ListByEndpoint. */ +public final class RoutesListByEndpointSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_ListByEndpoint.json + */ + /** + * Sample code: Routes_ListByEndpoint. + * + * @param manager Entry point to CdnManager. + */ + public static void routesListByEndpoint(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.routes().listByEndpoint("RG", "profile1", "endpoint1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java new file mode 100644 index 0000000000000..12e6297089447 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RoutesUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +import com.azure.resourcemanager.cdn.generated.models.AfdRouteCacheConfiguration; +import com.azure.resourcemanager.cdn.generated.models.CompressionSettings; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.ForwardingProtocol; +import com.azure.resourcemanager.cdn.generated.models.HttpsRedirect; +import com.azure.resourcemanager.cdn.generated.models.LinkToDefaultDomain; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.Route; +import java.util.Arrays; + +/** Samples for Routes Update. */ +public final class RoutesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Routes_Update.json + */ + /** + * Sample code: Routes_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void routesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Route resource = + manager.routes().getWithResponse("RG", "profile1", "endpoint1", "route1", Context.NONE).getValue(); + resource + .update() + .withCustomDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"))) + .withOriginGroup( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1")) + .withRuleSets( + Arrays + .asList( + new ResourceReference() + .withId( + "/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"))) + .withSupportedProtocols(Arrays.asList(AfdEndpointProtocols.HTTPS, AfdEndpointProtocols.HTTP)) + .withPatternsToMatch(Arrays.asList("/*")) + .withCacheConfiguration( + new AfdRouteCacheConfiguration() + .withQueryStringCachingBehavior(AfdQueryStringCachingBehavior.IGNORE_QUERY_STRING) + .withCompressionSettings( + new CompressionSettings() + .withContentTypesToCompress(Arrays.asList("text/html", "application/octet-stream")) + .withIsCompressionEnabled(true))) + .withForwardingProtocol(ForwardingProtocol.MATCH_REQUEST) + .withLinkToDefaultDomain(LinkToDefaultDomain.ENABLED) + .withHttpsRedirect(HttpsRedirect.ENABLED) + .withEnabledState(EnabledState.ENABLED) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java new file mode 100644 index 0000000000000..c398c9eab78e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsCreateSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for RuleSets Create. */ +public final class RuleSetsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Create.json + */ + /** + * Sample code: RuleSets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().createWithResponse("RG", "profile1", "ruleSet1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java new file mode 100644 index 0000000000000..331f5e9bd364a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for RuleSets Delete. */ +public final class RuleSetsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Delete.json + */ + /** + * Sample code: RuleSets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().delete("RG", "profile1", "ruleSet1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java new file mode 100644 index 0000000000000..ee80f80bd0db1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for RuleSets Get. */ +public final class RuleSetsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_Get.json + */ + /** + * Sample code: RuleSets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().getWithResponse("RG", "profile1", "ruleSet1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java new file mode 100644 index 0000000000000..4c2ec2dc76aca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for RuleSets ListByProfile. */ +public final class RuleSetsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_ListByProfile.json + */ + /** + * Sample code: RuleSets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java new file mode 100644 index 0000000000000..81c8aa1ea58a8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RuleSetsListResourceUsageSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for RuleSets ListResourceUsage. */ +public final class RuleSetsListResourceUsageSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/RuleSets_ListResourceUsage.json + */ + /** + * Sample code: RuleSets_ListResourceUsage. + * + * @param manager Entry point to CdnManager. + */ + public static void ruleSetsListResourceUsage(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.ruleSets().listResourceUsage("RG", "profile1", "ruleSet1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.java new file mode 100644 index 0000000000000..a050b5f71ac5a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesCreateSamples.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.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleRequestMethodCondition; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParameters; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodMatchConditionParametersMatchValuesItem; +import com.azure.resourcemanager.cdn.generated.models.RequestMethodOperator; +import java.util.Arrays; + +/** Samples for Rules Create. */ +public final class RulesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Create.json + */ + /** + * Sample code: Rules_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .rules() + .define("rule1") + .withExistingRuleSet("RG", "profile1", "ruleSet1") + .withOrder(1) + .withConditions( + Arrays + .asList( + new DeliveryRuleRequestMethodCondition() + .withParameters( + new RequestMethodMatchConditionParameters() + .withOperator(RequestMethodOperator.EQUAL) + .withNegateCondition(false) + .withMatchValues( + Arrays.asList(RequestMethodMatchConditionParametersMatchValuesItem.GET))))) + .withActions( + Arrays + .asList( + new DeliveryRuleResponseHeaderAction() + .withParameters( + new HeaderActionParameters() + .withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java new file mode 100644 index 0000000000000..1160911874ecc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules Delete. */ +public final class RulesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Delete.json + */ + /** + * Sample code: Rules_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().delete("RG", "profile1", "ruleSet1", "rule1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java new file mode 100644 index 0000000000000..4b13d314cd980 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules Get. */ +public final class RulesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Get.json + */ + /** + * Sample code: Rules_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java new file mode 100644 index 0000000000000..925fce1869745 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesListByRuleSetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Rules ListByRuleSet. */ +public final class RulesListByRuleSetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_ListByRuleSet.json + */ + /** + * Sample code: Rules_ListByRuleSet. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesListByRuleSet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.rules().listByRuleSet("RG", "profile1", "ruleSet1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.java new file mode 100644 index 0000000000000..45ed797f491c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/RulesUpdateSamples.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.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.DeliveryRuleResponseHeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderAction; +import com.azure.resourcemanager.cdn.generated.models.HeaderActionParameters; +import com.azure.resourcemanager.cdn.generated.models.Rule; +import java.util.Arrays; + +/** Samples for Rules Update. */ +public final class RulesUpdateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Rules_Update.json + */ + /** + * Sample code: Rules_Update. + * + * @param manager Entry point to CdnManager. + */ + public static void rulesUpdate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + Rule resource = manager.rules().getWithResponse("RG", "profile1", "ruleSet1", "rule1", Context.NONE).getValue(); + resource + .update() + .withOrder(1) + .withActions( + Arrays + .asList( + new DeliveryRuleResponseHeaderAction() + .withParameters( + new HeaderActionParameters() + .withHeaderAction(HeaderAction.OVERWRITE) + .withHeaderName("X-CDN") + .withValue("MSFT")))) + .apply(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.java new file mode 100644 index 0000000000000..0bd218f7b5f04 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsCreateSamples.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.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.CustomerCertificateParameters; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; + +/** Samples for Secrets Create. */ +public final class SecretsCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Create.json + */ + /** + * Sample code: Secrets_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .secrets() + .define("secret1") + .withExistingProfile("RG", "profile1") + .withParameters( + new CustomerCertificateParameters() + .withSecretSource( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/secrets/certificatename")) + .withSecretVersion("abcdef1234578900abcdef1234567890") + .withUseLatestVersion(false)) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java new file mode 100644 index 0000000000000..5f478be997027 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().delete("RG", "profile1", "secret1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java new file mode 100644 index 0000000000000..f09a8c7eb0d49 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().getWithResponse("RG", "profile1", "secret1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java new file mode 100644 index 0000000000000..1c59701488331 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecretsListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets ListByProfile. */ +public final class SecretsListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/Secrets_ListByProfile.json + */ + /** + * Sample code: Secrets_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void secretsListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.secrets().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.java new file mode 100644 index 0000000000000..4224cf8dd246c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesCreateSamples.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.cdn.generated.generated; + +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** Samples for SecurityPolicies Create. */ +public final class SecurityPoliciesCreateSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Create.json + */ + /** + * Sample code: SecurityPolicies_Create. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesCreate(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager + .securityPolicies() + .define("securityPolicy1") + .withExistingProfile("RG", "profile1") + .withParameters( + new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations( + Arrays + .asList( + new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .create(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..a97c04b146a1d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies Delete. */ +public final class SecurityPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Delete.json + */ + /** + * Sample code: SecurityPolicies_Delete. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesDelete(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().delete("RG", "profile1", "securityPolicy1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java new file mode 100644 index 0000000000000..6b2cc66751855 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies Get. */ +public final class SecurityPoliciesGetSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Get.json + */ + /** + * Sample code: SecurityPolicies_Get. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesGet(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().getWithResponse("RG", "profile1", "securityPolicy1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java new file mode 100644 index 0000000000000..be18f88230d8e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesListByProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for SecurityPolicies ListByProfile. */ +public final class SecurityPoliciesListByProfileSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_ListByProfile.json + */ + /** + * Sample code: SecurityPolicies_ListByProfile. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesListByProfile(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + manager.securityPolicies().listByProfile("RG", "profile1", Context.NONE); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java new file mode 100644 index 0000000000000..73113d18cfdbe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/samples/java/com/azure/resourcemanager/cdn/generated/generated/SecurityPoliciesPatchSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.models.ActivatedResourceReference; +import com.azure.resourcemanager.cdn.generated.models.ResourceReference; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicy; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallAssociation; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyWebApplicationFirewallParameters; +import java.util.Arrays; + +/** Samples for SecurityPolicies Patch. */ +public final class SecurityPoliciesPatchSamples { + /* + * x-ms-original-file: specification/cdn/resource-manager/Microsoft.Cdn/preview/2022-11-01-preview/examples/SecurityPolicies_Patch.json + */ + /** + * Sample code: SecurityPolicies_Patch. + * + * @param manager Entry point to CdnManager. + */ + public static void securityPoliciesPatch(com.azure.resourcemanager.cdn.generated.CdnManager manager) { + SecurityPolicy resource = + manager.securityPolicies().getWithResponse("RG", "profile1", "securityPolicy1", Context.NONE).getValue(); + resource + .update() + .withParameters( + new SecurityPolicyWebApplicationFirewallParameters() + .withWafPolicy( + new ResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest")) + .withAssociations( + Arrays + .asList( + new SecurityPolicyWebApplicationFirewallAssociation() + .withDomains( + Arrays + .asList( + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), + new ActivatedResourceReference() + .withId( + "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"))) + .withPatternsToMatch(Arrays.asList("/*"))))) + .apply(); + } +} diff --git a/sdk/cdn/ci.yml b/sdk/cdn/ci.yml new file mode 100644 index 0000000000000..44f37de383526 --- /dev/null +++ b/sdk/cdn/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/cdn/ci.yml + - sdk/cdn/azure-resourcemanager-cdn-generated/ + exclude: + - sdk/cdn/pom.xml + - sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.yml + - sdk/cdn/azure-resourcemanager-cdn-generated/ + exclude: + - sdk/cdn/pom.xml + - sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml + +parameters: + - name: release_azureresourcemanagercdngenerated + displayName: azure-resourcemanager-cdn-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: cdn + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-cdn-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercdngenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagercdngenerated }} diff --git a/sdk/cdn/pom.xml b/sdk/cdn/pom.xml new file mode 100644 index 0000000000000..ebddcd708d5e2 --- /dev/null +++ b/sdk/cdn/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-cdn-service + pom + 1.0.0 + + + azure-resourcemanager-cdn-generated + +