From e6997d0186255985c53779acb502f849237a535d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 9 Feb 2021 00:47:34 +0000 Subject: [PATCH] CodeGen from PR 12798 in Azure/azure-rest-api-specs Fix minor issues for AFDX public preview (#12798) * move systemdata to the end * update * revert unwanted change * ruleset & loganalytics changes * "collectionFormat": "multi" * fix model valiation * fix validation errors * Update readme.python.md * take 2 * take 3 * remove the lenient-model-deduplication fix as it didnt help Co-authored-by: Shirley Jiang --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 62 + .../cdn/generated/CdnManager.java | 478 +++ .../fluent/AfdCustomDomainsClient.java | 365 ++ .../generated/fluent/AfdEndpointsClient.java | 463 +++ .../fluent/AfdOriginGroupsClient.java | 326 ++ .../generated/fluent/AfdOriginsClient.java | 312 ++ .../generated/fluent/AfdProfilesClient.java | 78 + .../generated/fluent/CdnManagementClient.java | 207 ++ .../generated/fluent/CustomDomainsClient.java | 313 ++ .../cdn/generated/fluent/EdgeNodesClient.java | 36 + .../cdn/generated/fluent/EndpointsClient.java | 669 ++++ .../generated/fluent/LogAnalyticsClient.java | 314 ++ .../fluent/ManagedRuleSetsClient.java | 36 + .../generated/fluent/OperationsClient.java | 36 + .../generated/fluent/OriginGroupsClient.java | 327 ++ .../cdn/generated/fluent/OriginsClient.java | 310 ++ .../cdn/generated/fluent/PoliciesClient.java | 247 ++ .../cdn/generated/fluent/ProfilesClient.java | 376 ++ .../fluent/ResourceProvidersClient.java | 104 + .../fluent/ResourceUsagesClient.java | 36 + .../cdn/generated/fluent/RoutesClient.java | 326 ++ .../cdn/generated/fluent/RuleSetsClient.java | 230 ++ .../cdn/generated/fluent/RulesClient.java | 309 ++ .../cdn/generated/fluent/SecretsClient.java | 271 ++ .../fluent/SecurityPoliciesClient.java | 287 ++ .../cdn/generated/fluent/ValidatesClient.java | 40 + .../fluent/models/AfdDomainInner.java | 212 ++ .../fluent/models/AfdEndpointInner.java | 171 + .../fluent/models/AfdOriginGroupInner.java | 244 ++ .../fluent/models/AfdOriginInner.java | 347 ++ .../CdnWebApplicationFirewallPolicyInner.java | 300 ++ .../CheckNameAvailabilityOutputInner.java | 69 + .../models/ContinentsResponseInner.java | 85 + .../fluent/models/CustomDomainInner.java | 172 + .../fluent/models/EdgeNodeInner.java | 77 + .../fluent/models/EndpointInner.java | 619 ++++ .../models/ManagedRuleSetDefinitionInner.java | 144 + .../fluent/models/MetricsResponseInner.java | 135 + .../fluent/models/OperationInner.java | 69 + .../fluent/models/OriginGroupInner.java | 213 ++ .../generated/fluent/models/OriginInner.java | 415 +++ .../generated/fluent/models/ProfileInner.java | 125 + .../fluent/models/RankingsResponseInner.java | 108 + .../fluent/models/ResourceUsageInner.java | 84 + .../fluent/models/ResourcesResponseInner.java | 85 + .../generated/fluent/models/RouteInner.java | 422 +++ .../generated/fluent/models/RuleInner.java | 204 ++ .../generated/fluent/models/RuleSetInner.java | 78 + .../generated/fluent/models/SecretInner.java | 108 + .../fluent/models/SecurityPolicyInner.java | 108 + .../generated/fluent/models/SsoUriInner.java | 39 + ...ortedOptimizationTypesListResultInner.java | 41 + .../generated/fluent/models/UsageInner.java | 157 + .../ValidateCustomDomainOutputInner.java | 69 + .../models/ValidateProbeOutputInner.java | 69 + .../models/ValidateSecretOutputInner.java | 77 + .../fluent/models/ValidationTokenInner.java | 39 + .../models/WafMetricsResponseInner.java | 135 + .../models/WafRankingsResponseInner.java | 134 + .../generated/fluent/models/package-info.java | 6 + .../cdn/generated/fluent/package-info.java | 6 + .../AfdCustomDomainsClientImpl.java | 1787 +++++++++ .../implementation/AfdCustomDomainsImpl.java | 213 ++ .../implementation/AfdDomainImpl.java | 208 ++ .../implementation/AfdEndpointImpl.java | 258 ++ .../AfdEndpointsClientImpl.java | 2363 ++++++++++++ .../implementation/AfdEndpointsImpl.java | 260 ++ .../implementation/AfdOriginGroupImpl.java | 244 ++ .../AfdOriginGroupsClientImpl.java | 1790 +++++++++ .../implementation/AfdOriginGroupsImpl.java | 205 ++ .../implementation/AfdOriginImpl.java | 284 ++ .../implementation/AfdOriginsClientImpl.java | 1593 ++++++++ .../implementation/AfdOriginsImpl.java | 223 ++ .../implementation/AfdProfilesClientImpl.java | 540 +++ .../implementation/AfdProfilesImpl.java | 86 + .../CdnManagementClientBuilder.java | 146 + .../CdnManagementClientImpl.java | 601 +++ .../CdnWebApplicationFirewallPolicyImpl.java | 260 ++ .../CheckNameAvailabilityOutputImpl.java | 40 + .../ContinentsResponseImpl.java | 50 + .../implementation/CustomDomainImpl.java | 181 + .../CustomDomainsClientImpl.java | 1713 +++++++++ .../implementation/CustomDomainsImpl.java | 309 ++ .../implementation/EdgeNodeImpl.java | 57 + .../implementation/EdgeNodesClientImpl.java | 269 ++ .../implementation/EdgeNodesImpl.java | 46 + .../implementation/EndpointImpl.java | 505 +++ .../implementation/EndpointsClientImpl.java | 3255 +++++++++++++++++ .../implementation/EndpointsImpl.java | 312 ++ .../LogAnalyticsClientImpl.java | 1950 ++++++++++ .../implementation/LogAnalyticsImpl.java | 341 ++ .../ManagedRuleSetDefinitionImpl.java | 74 + .../ManagedRuleSetsClientImpl.java | 295 ++ .../implementation/ManagedRuleSetsImpl.java | 46 + .../implementation/MetricsResponseImpl.java | 54 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationsClientImpl.java | 269 ++ .../implementation/OperationsImpl.java | 46 + .../implementation/OriginGroupImpl.java | 236 ++ .../OriginGroupsClientImpl.java | 1620 ++++++++ .../implementation/OriginGroupsImpl.java | 226 ++ .../generated/implementation/OriginImpl.java | 314 ++ .../implementation/OriginsClientImpl.java | 1561 ++++++++ .../generated/implementation/OriginsImpl.java | 220 ++ .../implementation/PoliciesClientImpl.java | 1304 +++++++ .../implementation/PoliciesImpl.java | 180 + .../generated/implementation/ProfileImpl.java | 224 ++ .../implementation/ProfilesClientImpl.java | 2209 +++++++++++ .../implementation/ProfilesImpl.java | 238 ++ .../implementation/RankingsResponseImpl.java | 49 + .../ResourceProvidersClientImpl.java | 530 +++ .../implementation/ResourceProvidersImpl.java | 115 + .../implementation/ResourceUsageImpl.java | 44 + .../ResourceUsagesClientImpl.java | 295 ++ .../implementation/ResourceUsagesImpl.java | 46 + .../implementation/ResourcesResponseImpl.java | 50 + .../generated/implementation/RouteImpl.java | 347 ++ .../implementation/RoutesClientImpl.java | 1596 ++++++++ .../generated/implementation/RoutesImpl.java | 220 ++ .../generated/implementation/RuleImpl.java | 221 ++ .../generated/implementation/RuleSetImpl.java | 55 + .../implementation/RuleSetsClientImpl.java | 1373 +++++++ .../implementation/RuleSetsImpl.java | 113 + .../implementation/RulesClientImpl.java | 1553 ++++++++ .../generated/implementation/RulesImpl.java | 220 ++ .../generated/implementation/SecretImpl.java | 160 + .../implementation/SecretsClientImpl.java | 1406 +++++++ .../generated/implementation/SecretsImpl.java | 188 + .../SecurityPoliciesClientImpl.java | 1472 ++++++++ .../implementation/SecurityPoliciesImpl.java | 197 + .../implementation/SecurityPolicyImpl.java | 161 + .../generated/implementation/SsoUriImpl.java | 32 + ...portedOptimizationTypesListResultImpl.java | 41 + .../generated/implementation/UsageImpl.java | 50 + .../cdn/generated/implementation/Utils.java | 67 + .../ValidateCustomDomainOutputImpl.java | 40 + .../ValidateProbeOutputImpl.java | 40 + .../ValidateSecretOutputImpl.java | 37 + .../implementation/ValidatesClientImpl.java | 210 ++ .../implementation/ValidatesImpl.java | 61 + .../implementation/ValidationTokenImpl.java | 32 + .../WafMetricsResponseImpl.java | 54 + .../WafRankingsResponseImpl.java | 58 + .../implementation/package-info.java | 6 + .../cdn/generated/models/ActionType.java | 40 + .../generated/models/AfdCertificateType.java | 34 + .../generated/models/AfdCustomDomains.java | 182 + .../cdn/generated/models/AfdDomain.java | 260 ++ .../models/AfdDomainHttpsParameters.java | 111 + .../generated/models/AfdDomainListResult.java | 73 + .../generated/models/AfdDomainProperties.java | 137 + .../models/AfdDomainUpdateParameters.java | 91 + .../AfdDomainUpdatePropertiesParameters.java | 89 + .../cdn/generated/models/AfdEndpoint.java | 358 ++ .../models/AfdEndpointListResult.java | 73 + .../models/AfdEndpointProperties.java | 87 + ...AfdEndpointPropertiesUpdateParameters.java | 81 + .../models/AfdEndpointProtocols.java | 34 + .../models/AfdEndpointUpdateParameters.java | 109 + .../cdn/generated/models/AfdEndpoints.java | 256 ++ .../models/AfdMinimumTlsVersion.java | 47 + .../cdn/generated/models/AfdOrigin.java | 447 +++ .../cdn/generated/models/AfdOriginGroup.java | 348 ++ .../models/AfdOriginGroupListResult.java | 73 + .../models/AfdOriginGroupProperties.java | 95 + .../AfdOriginGroupUpdateParameters.java | 186 + ...OriginGroupUpdatePropertiesParameters.java | 184 + .../cdn/generated/models/AfdOriginGroups.java | 170 + .../generated/models/AfdOriginListResult.java | 73 + .../generated/models/AfdOriginProperties.java | 119 + .../models/AfdOriginUpdateParameters.java | 290 ++ .../AfdOriginUpdatePropertiesParameters.java | 288 ++ .../cdn/generated/models/AfdOrigins.java | 150 + .../cdn/generated/models/AfdProfiles.java | 69 + .../models/AfdProvisioningState.java | 43 + .../generated/models/AfdPurgeParameters.java | 85 + .../models/AfdQueryStringCachingBehavior.java | 50 + .../generated/models/AfdStateProperties.java | 54 + .../cdn/generated/models/Algorithm.java | 31 + .../cdn/generated/models/CacheBehavior.java | 37 + .../CacheExpirationActionParameters.java | 148 + .../CacheKeyQueryStringActionParameters.java | 113 + .../cdn/generated/models/CacheType.java | 31 + .../CdnCertificateSourceParameters.java | 87 + .../cdn/generated/models/CdnEndpoint.java | 50 + .../models/CdnManagedHttpsParameters.java | 82 + .../CdnWebApplicationFirewallPolicy.java | 335 ++ .../CdnWebApplicationFirewallPolicyList.java | 75 + ...licationFirewallPolicyPatchParameters.java | 52 + .../cdn/generated/models/Certificate.java | 102 + .../generated/models/CertificateSource.java | 34 + .../cdn/generated/models/CertificateType.java | 34 + .../models/CheckNameAvailabilityInput.java | 86 + .../models/CheckNameAvailabilityOutput.java | 38 + .../cdn/generated/models/CidrIpAddress.java | 76 + ...pertiesSeriesItemsPropertiesDataItems.java | 80 + ...pertiesSeriesItemsPropertiesDataItems.java | 80 + ...ertiesDataItemsPropertiesMetricsItems.java | 106 + .../generated/models/ContinentsResponse.java | 32 + .../ContinentsResponseContinentsItem.java | 50 + ...ontinentsResponseCountryOrRegionsItem.java | 76 + .../CookiesMatchConditionParameters.java | 192 + .../cdn/generated/models/CookiesOperator.java | 58 + .../cdn/generated/models/CustomDomain.java | 203 + .../models/CustomDomainHttpsParameters.java | 95 + .../models/CustomDomainListResult.java | 73 + .../models/CustomDomainParameters.java | 52 + .../models/CustomDomainResourceState.java | 37 + .../cdn/generated/models/CustomDomains.java | 224 ++ .../models/CustomHttpsProvisioningState.java | 43 + .../CustomHttpsProvisioningSubstate.java | 63 + .../cdn/generated/models/CustomRule.java | 176 + .../models/CustomRuleEnabledState.java | 34 + .../cdn/generated/models/CustomRuleList.java | 54 + .../generated/models/CustomerCertificate.java | 184 + .../models/CustomerCertificateParameters.java | 169 + .../generated/models/DeepCreatedOrigin.java | 373 ++ .../models/DeepCreatedOriginGroup.java | 191 + .../cdn/generated/models/DeleteRule.java | 31 + .../cdn/generated/models/DeliveryRule.java | 148 + .../generated/models/DeliveryRuleAction.java | 42 + .../models/DeliveryRuleActionValue.java | 52 + .../DeliveryRuleCacheExpirationAction.java | 64 + ...DeliveryRuleCacheKeyQueryStringAction.java | 64 + .../models/DeliveryRuleCondition.java | 48 + .../models/DeliveryRuleCookiesCondition.java | 64 + .../DeliveryRuleHttpVersionCondition.java | 64 + .../models/DeliveryRuleIsDeviceCondition.java | 64 + .../models/DeliveryRulePostArgsCondition.java | 64 + .../DeliveryRuleQueryStringCondition.java | 64 + .../DeliveryRuleRemoteAddressCondition.java | 64 + .../DeliveryRuleRequestBodyCondition.java | 64 + .../DeliveryRuleRequestHeaderAction.java | 64 + .../DeliveryRuleRequestHeaderCondition.java | 64 + .../DeliveryRuleRequestMethodCondition.java | 64 + .../DeliveryRuleRequestSchemeCondition.java | 64 + .../DeliveryRuleRequestUriCondition.java | 64 + .../DeliveryRuleResponseHeaderAction.java | 64 + ...DeliveryRuleUrlFileExtensionCondition.java | 64 + .../DeliveryRuleUrlFileNameCondition.java | 64 + .../models/DeliveryRuleUrlPathCondition.java | 64 + .../generated/models/DeploymentStatus.java | 40 + .../generated/models/DestinationProtocol.java | 37 + .../models/DomainValidationProperties.java | 54 + .../models/DomainValidationState.java | 46 + .../cdn/generated/models/EdgeNode.java | 53 + .../cdn/generated/models/EdgeNodes.java | 31 + .../cdn/generated/models/EdgenodeResult.java | 73 + .../cdn/generated/models/EnabledState.java | 34 + .../cdn/generated/models/Endpoint.java | 904 +++++ .../generated/models/EndpointListResult.java | 73 + .../generated/models/EndpointProperties.java | 238 ++ .../EndpointPropertiesUpdateParameters.java | 463 +++ ...pertiesUpdateParametersDeliveryPolicy.java | 86 + ...etersWebApplicationFirewallPolicyLink.java | 52 + .../models/EndpointResourceState.java | 46 + .../models/EndpointUpdateParameters.java | 492 +++ .../cdn/generated/models/Endpoints.java | 350 ++ .../generated/models/ForwardingProtocol.java | 37 + .../cdn/generated/models/GeoFilter.java | 124 + .../generated/models/GeoFilterActions.java | 47 + .../cdn/generated/models/HeaderAction.java | 37 + .../models/HeaderActionParameters.java | 145 + .../models/HealthProbeParameters.java | 129 + .../models/HealthProbeRequestType.java | 50 + .../models/HttpErrorRangeParameters.java | 76 + .../HttpVersionMatchConditionParameters.java | 140 + .../generated/models/HttpVersionOperator.java | 31 + .../cdn/generated/models/HttpsRedirect.java | 34 + .../cdn/generated/models/IdentityType.java | 40 + .../cdn/generated/models/IpAddressGroup.java | 109 + .../IsDeviceMatchConditionParameters.java | 167 + ...tchConditionParametersMatchValuesItem.java | 35 + .../generated/models/IsDeviceOperator.java | 31 + .../KeyVaultCertificateSourceParameters.java | 280 ++ .../models/KeyVaultSigningKeyParameters.java | 215 ++ .../generated/models/LinkToDefaultDomain.java | 34 + .../LoadBalancingSettingsParameters.java | 106 + .../cdn/generated/models/LoadParameters.java | 59 + .../cdn/generated/models/LogAnalytics.java | 283 ++ .../cdn/generated/models/LogMetric.java | 46 + .../models/LogMetricsGranularity.java | 37 + .../generated/models/LogMetricsGroupBy.java | 43 + .../cdn/generated/models/LogRanking.java | 43 + .../generated/models/LogRankingMetric.java | 46 + .../generated/models/ManagedCertificate.java | 46 + .../models/ManagedCertificateParameters.java | 29 + .../models/ManagedRuleDefinition.java | 54 + .../models/ManagedRuleEnabledState.java | 34 + .../models/ManagedRuleGroupDefinition.java | 73 + .../models/ManagedRuleGroupOverride.java | 89 + .../generated/models/ManagedRuleOverride.java | 110 + .../cdn/generated/models/ManagedRuleSet.java | 145 + .../models/ManagedRuleSetDefinition.java | 82 + .../models/ManagedRuleSetDefinitionList.java | 70 + .../generated/models/ManagedRuleSetList.java | 54 + .../cdn/generated/models/ManagedRuleSets.java | 31 + .../cdn/generated/models/MatchCondition.java | 199 + .../models/MatchProcessingBehavior.java | 34 + .../cdn/generated/models/MatchVariable.java | 76 + .../cdn/generated/models/MetricsResponse.java | 47 + .../models/MetricsResponseGranularity.java | 37 + .../models/MetricsResponseSeriesItem.java | 136 + .../models/MetricsResponseSeriesItemUnit.java | 37 + ...ricsResponseSeriesPropertiesItemsItem.java | 76 + .../generated/models/MinimumTlsVersion.java | 50 + .../cdn/generated/models/Operation.java | 31 + .../generated/models/OperationDisplay.java | 69 + .../cdn/generated/models/Operations.java | 31 + .../models/OperationsListResult.java | 73 + .../cdn/generated/models/Operator.java | 64 + .../generated/models/OptimizationType.java | 43 + .../cdn/generated/models/Origin.java | 520 +++ .../cdn/generated/models/OriginGroup.java | 295 ++ .../models/OriginGroupListResult.java | 73 + .../models/OriginGroupOverrideAction.java | 64 + .../OriginGroupOverrideActionParameters.java | 89 + .../models/OriginGroupProperties.java | 89 + .../models/OriginGroupResourceState.java | 37 + .../models/OriginGroupUpdateParameters.java | 157 + ...OriginGroupUpdatePropertiesParameters.java | 155 + .../cdn/generated/models/OriginGroups.java | 150 + .../generated/models/OriginListResult.java | 73 + .../generated/models/OriginProperties.java | 148 + .../generated/models/OriginResourceState.java | 37 + .../models/OriginUpdateParameters.java | 345 ++ .../OriginUpdatePropertiesParameters.java | 343 ++ .../cdn/generated/models/Origins.java | 149 + .../cdn/generated/models/ParamIndicator.java | 37 + .../cdn/generated/models/Policies.java | 138 + .../generated/models/PolicyEnabledState.java | 34 + .../cdn/generated/models/PolicyMode.java | 34 + .../generated/models/PolicyResourceState.java | 46 + .../cdn/generated/models/PolicySettings.java | 164 + ...sDefaultCustomBlockResponseStatusCode.java | 44 + .../PostArgsMatchConditionParameters.java | 192 + .../generated/models/PostArgsOperator.java | 58 + .../models/PrivateEndpointStatus.java | 43 + .../cdn/generated/models/ProbeProtocol.java | 50 + .../cdn/generated/models/Profile.java | 302 ++ .../generated/models/ProfileListResult.java | 73 + .../models/ProfileResourceState.java | 40 + .../models/ProfileUpdateParameters.java | 51 + .../cdn/generated/models/Profiles.java | 243 ++ .../cdn/generated/models/ProtocolType.java | 34 + .../generated/models/ProvisioningState.java | 37 + .../cdn/generated/models/PurgeParameters.java | 59 + .../generated/models/QueryStringBehavior.java | 40 + .../models/QueryStringCachingBehavior.java | 53 + .../QueryStringMatchConditionParameters.java | 166 + .../generated/models/QueryStringOperator.java | 58 + .../generated/models/RankingsResponse.java | 40 + .../models/RankingsResponseTablesItem.java | 80 + ...ingsResponseTablesPropertiesItemsItem.java | 81 + ...ponseTablesPropertiesItemsMetricsItem.java | 103 + .../cdn/generated/models/RateLimitRule.java | 114 + .../generated/models/RateLimitRuleList.java | 54 + .../cdn/generated/models/RedirectType.java | 40 + ...RemoteAddressMatchConditionParameters.java | 172 + .../models/RemoteAddressOperator.java | 37 + .../RequestBodyMatchConditionParameters.java | 166 + .../generated/models/RequestBodyOperator.java | 58 + ...RequestHeaderMatchConditionParameters.java | 192 + .../models/RequestHeaderOperator.java | 58 + ...RequestMethodMatchConditionParameters.java | 141 + ...tchConditionParametersMatchValuesItem.java | 50 + .../models/RequestMethodOperator.java | 31 + ...RequestSchemeMatchConditionParameters.java | 136 + ...tchConditionParametersMatchValuesItem.java | 35 + .../RequestUriMatchConditionParameters.java | 166 + .../generated/models/RequestUriOperator.java | 58 + .../generated/models/ResourceProviders.java | 91 + .../generated/models/ResourceReference.java | 50 + .../cdn/generated/models/ResourceUsage.java | 45 + .../models/ResourceUsageListResult.java | 70 + .../cdn/generated/models/ResourceUsages.java | 31 + .../generated/models/ResourcesResponse.java | 32 + .../ResourcesResponseCustomDomainsItem.java | 128 + .../ResourcesResponseEndpointsItem.java | 133 + ...sResponseEndpointsPropertiesItemsItem.java | 129 + .../ResponseBasedDetectedErrorTypes.java | 50 + ...seBasedOriginErrorDetectionParameters.java | 118 + .../cdn/generated/models/Route.java | 519 +++ .../cdn/generated/models/RouteListResult.java | 73 + .../cdn/generated/models/RouteProperties.java | 141 + .../models/RouteUpdateParameters.java | 364 ++ .../RouteUpdatePropertiesParameters.java | 362 ++ .../cdn/generated/models/Routes.java | 161 + .../cdn/generated/models/Rule.java | 282 ++ .../cdn/generated/models/RuleListResult.java | 73 + .../cdn/generated/models/RuleProperties.java | 85 + .../cdn/generated/models/RuleSet.java | 59 + .../generated/models/RuleSetListResult.java | 73 + .../generated/models/RuleSetProperties.java | 25 + .../cdn/generated/models/RuleSets.java | 151 + .../models/RuleUpdateParameters.java | 149 + .../RuleUpdatePropertiesParameters.java | 147 + .../cdn/generated/models/Rules.java | 149 + .../cdn/generated/models/Secret.java | 170 + .../generated/models/SecretListResult.java | 73 + .../generated/models/SecretParameters.java | 37 + .../generated/models/SecretProperties.java | 55 + .../cdn/generated/models/SecretType.java | 37 + .../cdn/generated/models/Secrets.java | 141 + .../generated/models/SecurityPolicies.java | 142 + .../cdn/generated/models/SecurityPolicy.java | 170 + .../models/SecurityPolicyListResult.java | 73 + .../models/SecurityPolicyParameters.java | 35 + .../models/SecurityPolicyProperties.java | 55 + .../generated/models/SecurityPolicyType.java | 31 + ...licyWebApplicationFirewallAssociation.java | 81 + ...olicyWebApplicationFirewallParameters.java | 91 + .../SharedPrivateLinkResourceStatus.java | 56 + .../cdn/generated/models/Sku.java | 50 + .../cdn/generated/models/SkuName.java | 72 + .../cdn/generated/models/SsoUri.java | 24 + .../cdn/generated/models/Status.java | 40 + .../SupportedOptimizationTypesListResult.java | 26 + .../cdn/generated/models/SystemData.java | 181 + .../cdn/generated/models/Transform.java | 34 + .../cdn/generated/models/TransformType.java | 46 + .../cdn/generated/models/UpdateRule.java | 31 + ...FileExtensionMatchConditionParameters.java | 166 + .../models/UrlFileExtensionOperator.java | 58 + .../UrlFileNameMatchConditionParameters.java | 166 + .../generated/models/UrlFileNameOperator.java | 58 + .../UrlPathMatchConditionParameters.java | 166 + .../cdn/generated/models/UrlPathOperator.java | 61 + .../generated/models/UrlRedirectAction.java | 63 + .../models/UrlRedirectActionParameters.java | 231 ++ .../generated/models/UrlRewriteAction.java | 63 + .../models/UrlRewriteActionParameters.java | 149 + .../generated/models/UrlSigningAction.java | 63 + .../models/UrlSigningActionParameters.java | 114 + .../cdn/generated/models/UrlSigningKey.java | 92 + .../models/UrlSigningKeyParameters.java | 124 + .../models/UrlSigningParamIdentifier.java | 88 + .../cdn/generated/models/Usage.java | 52 + .../cdn/generated/models/UsageName.java | 76 + .../cdn/generated/models/UsageUnit.java | 31 + .../generated/models/UsagesListResult.java | 81 + .../models/UserManagedHttpsParameters.java | 82 + .../models/ValidateCustomDomainInput.java | 56 + .../models/ValidateCustomDomainOutput.java | 38 + .../generated/models/ValidateProbeInput.java | 55 + .../generated/models/ValidateProbeOutput.java | 38 + .../generated/models/ValidateSecretInput.java | 89 + .../models/ValidateSecretOutput.java | 31 + .../generated/models/ValidateSecretType.java | 37 + .../cdn/generated/models/Validates.java | 34 + .../cdn/generated/models/ValidationToken.java | 24 + .../cdn/generated/models/WafAction.java | 40 + .../cdn/generated/models/WafGranularity.java | 37 + .../cdn/generated/models/WafMetric.java | 31 + .../generated/models/WafMetricsResponse.java | 47 + .../models/WafMetricsResponseGranularity.java | 37 + .../models/WafMetricsResponseSeriesItem.java | 136 + .../WafMetricsResponseSeriesItemUnit.java | 44 + ...ricsResponseSeriesPropertiesItemsItem.java | 76 + .../generated/models/WafRankingGroupBy.java | 34 + .../cdn/generated/models/WafRankingType.java | 52 + .../generated/models/WafRankingsResponse.java | 47 + .../models/WafRankingsResponseDataItem.java | 81 + .../cdn/generated/models/WafRuleType.java | 37 + .../cdn/generated/models/package-info.java | 6 + .../cdn/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/cdn/ci.yml | 31 + sdk/cdn/pom.xml | 53 + 473 files changed, 85215 insertions(+) create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/README.md create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EdgeNodesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OperationsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginGroupsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/OriginsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceUsagesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ValidatesClient.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CheckNameAvailabilityOutputInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ContinentsResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/MetricsResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RankingsResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourcesResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SsoUriInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SupportedOptimizationTypesListResultInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateCustomDomainOutputInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateProbeOutputInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidateSecretOutputInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidationTokenInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafMetricsResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/WafRankingsResponseInner.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/package-info.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/package-info.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ContinentsResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetDefinitionImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/MetricsResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RankingsResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourcesResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SupportedOptimizationTypesListResultImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/Utils.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateCustomDomainOutputImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateProbeOutputImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateSecretOutputImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesClientImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidationTokenImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafMetricsResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/WafRankingsResponseImpl.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/package-info.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointPropertiesUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdStateProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnEndpoint.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityOutput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CidrIpAddress.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseContinentsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ContinentsResponseCountryOrRegionsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleList.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOriginGroup.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNodes.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgenodeResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoints.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpErrorRangeParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IdentityType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IpAddressGroup.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParametersMatchValuesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleDefinition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupDefinition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinitionList.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetList.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseGranularity.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemUnit.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesPropertiesItemsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operations.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroups.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origins.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RateLimitRuleList.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParametersMatchValuesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParametersMatchValuesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceReference.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsage.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsageListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceUsages.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseCustomDomainsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdatePropertiesParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyProperties.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SsoUri.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SupportedOptimizationTypesListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SystemData.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Usage.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageName.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsagesListResult.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainOutput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeOutput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretOutput.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Validates.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidationToken.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseGranularity.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemUnit.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesPropertiesItemsItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponse.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/package-info.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/package-info.java create mode 100644 sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/module-info.java create mode 100644 sdk/cdn/ci.yml create mode 100644 sdk/cdn/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7a987a84736ad..bd0924f4c981b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -199,6 +199,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;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 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 3d84dd84ceb34..224ef2942e221 100644 --- a/pom.xml +++ b/pom.xml @@ -562,6 +562,7 @@ sdk/authorization sdk/batch sdk/boms + sdk/cdn sdk/cognitiveservices sdk/communication sdk/confluent 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..4644649766a8e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-09) + +- Azure Resource Manager Cdn client library for Java. This package contains Microsoft Azure SDK for Cdn Management SDK. Cdn Management Client. Package tag package-2020-09. 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..6b1da95349c7e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/README.md @@ -0,0 +1,99 @@ +# 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-2020-09. 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 + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/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/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md 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..e9bf3fe128155 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/pom.xml @@ -0,0 +1,62 @@ + + 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. Cdn Management Client. Package tag package-2020-09. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + 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 + + + + + com.azure + azure-core-management + 1.1.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + 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..2dd668af4392f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/CdnManager.java @@ -0,0 +1,478 @@ +// Copyright (c) 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.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.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.implementation.ValidatesImpl; +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 com.azure.resourcemanager.cdn.generated.models.Validates; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to CdnManager. Cdn Management Client. */ +public final class CdnManager { + private Profiles profiles; + + private Endpoints endpoints; + + private Origins origins; + + private OriginGroups originGroups; + + private CustomDomains customDomains; + + private ResourceProviders resourceProviders; + + private ResourceUsages resourceUsages; + + private Operations operations; + + private EdgeNodes edgeNodes; + + 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 Validates validates; + + private LogAnalytics logAnalytics; + + 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); + } + + /** + * 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 final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of 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 (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + 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); + } + } + + /** @return Resource collection API of Profiles. */ + public Profiles profiles() { + if (this.profiles == null) { + this.profiles = new ProfilesImpl(clientObject.getProfiles(), this); + } + return profiles; + } + + /** @return Resource collection API of Endpoints. */ + public Endpoints endpoints() { + if (this.endpoints == null) { + this.endpoints = new EndpointsImpl(clientObject.getEndpoints(), this); + } + return endpoints; + } + + /** @return Resource collection API of Origins. */ + public Origins origins() { + if (this.origins == null) { + this.origins = new OriginsImpl(clientObject.getOrigins(), this); + } + return origins; + } + + /** @return Resource collection API of OriginGroups. */ + public OriginGroups originGroups() { + if (this.originGroups == null) { + this.originGroups = new OriginGroupsImpl(clientObject.getOriginGroups(), this); + } + return originGroups; + } + + /** @return Resource collection API of CustomDomains. */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(clientObject.getCustomDomains(), this); + } + return customDomains; + } + + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** @return Resource collection API of ResourceUsages. */ + public ResourceUsages resourceUsages() { + if (this.resourceUsages == null) { + this.resourceUsages = new ResourceUsagesImpl(clientObject.getResourceUsages(), this); + } + return resourceUsages; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of EdgeNodes. */ + public EdgeNodes edgeNodes() { + if (this.edgeNodes == null) { + this.edgeNodes = new EdgeNodesImpl(clientObject.getEdgeNodes(), this); + } + return edgeNodes; + } + + /** @return Resource collection API of AfdProfiles. */ + public AfdProfiles afdProfiles() { + if (this.afdProfiles == null) { + this.afdProfiles = new AfdProfilesImpl(clientObject.getAfdProfiles(), this); + } + return afdProfiles; + } + + /** @return Resource collection API of AfdCustomDomains. */ + public AfdCustomDomains afdCustomDomains() { + if (this.afdCustomDomains == null) { + this.afdCustomDomains = new AfdCustomDomainsImpl(clientObject.getAfdCustomDomains(), this); + } + return afdCustomDomains; + } + + /** @return Resource collection API of AfdEndpoints. */ + public AfdEndpoints afdEndpoints() { + if (this.afdEndpoints == null) { + this.afdEndpoints = new AfdEndpointsImpl(clientObject.getAfdEndpoints(), this); + } + return afdEndpoints; + } + + /** @return Resource collection API of AfdOriginGroups. */ + public AfdOriginGroups afdOriginGroups() { + if (this.afdOriginGroups == null) { + this.afdOriginGroups = new AfdOriginGroupsImpl(clientObject.getAfdOriginGroups(), this); + } + return afdOriginGroups; + } + + /** @return Resource collection API of AfdOrigins. */ + public AfdOrigins afdOrigins() { + if (this.afdOrigins == null) { + this.afdOrigins = new AfdOriginsImpl(clientObject.getAfdOrigins(), this); + } + return afdOrigins; + } + + /** @return Resource collection API of Routes. */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** @return Resource collection API of RuleSets. */ + public RuleSets ruleSets() { + if (this.ruleSets == null) { + this.ruleSets = new RuleSetsImpl(clientObject.getRuleSets(), this); + } + return ruleSets; + } + + /** @return Resource collection API of Rules. */ + public Rules rules() { + if (this.rules == null) { + this.rules = new RulesImpl(clientObject.getRules(), this); + } + return rules; + } + + /** @return Resource collection API of SecurityPolicies. */ + public SecurityPolicies securityPolicies() { + if (this.securityPolicies == null) { + this.securityPolicies = new SecurityPoliciesImpl(clientObject.getSecurityPolicies(), this); + } + return securityPolicies; + } + + /** @return Resource collection API of Secrets. */ + public Secrets secrets() { + if (this.secrets == null) { + this.secrets = new SecretsImpl(clientObject.getSecrets(), this); + } + return secrets; + } + + /** @return Resource collection API of Validates. */ + public Validates validates() { + if (this.validates == null) { + this.validates = new ValidatesImpl(clientObject.getValidates(), this); + } + return validates; + } + + /** @return Resource collection API of LogAnalytics. */ + public LogAnalytics logAnalytics() { + if (this.logAnalytics == null) { + this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this); + } + return logAnalytics; + } + + /** @return Resource collection API of Policies. */ + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + } + return policies; + } + + /** @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..79321c6bf4243 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdCustomDomainsClient.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; + +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.fluent.models.ValidationTokenInner; +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 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 domains. + */ + @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 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 domains. + */ + @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 CDN 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); + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ValidationTokenInner> 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ValidationTokenInner> 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTokenInner 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTokenInner 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..cc78100b730bf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdEndpointsClient.java @@ -0,0 +1,463 @@ +// Copyright (c) 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 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. + */ + @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 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. + */ + @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 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 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); + + /** + * 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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint); + + /** + * 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint); + + /** + * 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, 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 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) + 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 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) + 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 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) + 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 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) + 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 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); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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 CDN 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 list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + @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 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); +} 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..6c06aa9432d00 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginGroupsClient.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.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 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 origin groups. + */ + @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 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 origin groups. + */ + @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 CDN 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); + + /** + * Gets an existing origin group within a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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 CDN 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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + @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..c3b793935bd6a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdOriginsClient.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.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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, String originName, 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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..fd7b5100458c9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/AfdProfilesClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.util.Context; +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.ValidateCustomDomainInput; + +/** 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 CDN 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 list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateCustomDomainOutputInner checkHostnameAvailability( + String resourceGroupName, String profileName, ValidateCustomDomainInput checkHostnameAvailabilityInput); + + /** + * 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + ValidateCustomDomainInput checkHostnameAvailabilityInput, + 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..ebe8697a86452 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CdnManagementClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * 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 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 ValidatesClient object to access its operations. + * + * @return the ValidatesClient object. + */ + ValidatesClient getValidates(); + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + LogAnalyticsClient getLogAnalytics(); + + /** + * 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..944a260c62878 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/CustomDomainsClient.java @@ -0,0 +1,313 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 response. + */ + @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disableCustomHttpsWithResponse( + 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 response. + */ + @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableCustomHttpsWithResponse( + 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..ecd9c1a30e714 --- /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. + */ + @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. + */ + @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..6916afa46f949 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/EndpointsClient.java @@ -0,0 +1,669 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, 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 endpoint 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) + SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint); + + /** + * 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 endpoint 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) + SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, 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 endpoint 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 endpoint); + + /** + * 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 endpoint 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 endpoint, 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) + 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 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) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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) + 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 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) + 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 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) + 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 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) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context 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 com.azure.core.management.exception.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. + */ + @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. + */ + @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..35fae0e3ff662 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/LogAnalyticsClient.java @@ -0,0 +1,314 @@ +// Copyright (c) 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 CDN profile 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 report for AFD 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 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. + */ + @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 analytics ranking report for AFD 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 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 log analytics ranking report for AFD 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 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. + */ + @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 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 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 all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * 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 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 all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsLocationsWithResponse( + 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 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 all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourcesResponseInner getLogAnalyticsResources(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 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 all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, 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 CDN profile 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 related log analytics report for AFD 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 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. + */ + @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 log analytics charts for AFD 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 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); + + /** + * Get WAF log analytics charts for AFD 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 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. + */ + @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); +} 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..dee42452d8131 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ManagedRuleSetsClient.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.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. + */ + @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. + */ + @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..2bcfa2a622e56 --- /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. + */ + @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. + */ + @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..25fc6b9c43e87 --- /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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, 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) + 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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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..ec5a4c7a0d257 --- /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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, 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) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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..df1e3f41069f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/PoliciesClient.java @@ -0,0 +1,247 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, 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) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String policyName, Context context); +} 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..e980d96f06e78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ProfilesClient.java @@ -0,0 +1,376 @@ +// Copyright (c) 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.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.ProfileUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ProfilesClient. */ +public interface ProfilesClient { + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a 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 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Gets a 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 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile); + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile, Context context); + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile); + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile, Context context); + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters, Context context); + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update(String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters); + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProfileInner update( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters, Context context); + + /** + * Deletes an existing 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName); + + /** + * Deletes an existing 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an existing 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 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 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 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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateSsoUriWithResponse(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 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); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + @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..1eb9e08c5f2ef --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ResourceProvidersClient.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.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.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateProbeOutputInner; +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 + * 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. + */ + @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 checkNameAvailabilityWithSubscription( + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateProbeWithResponse( + ValidateProbeInput validateProbeInput, Context context); +} 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..76dc3d3ac9e16 --- /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. + */ + @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. + */ + @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..3c907a4afe0b5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RoutesClient.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.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 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 routes. + */ + @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 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 routes. + */ + @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 CDN 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); + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String routeName, 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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..250d3d5918f93 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RuleSetsClient.java @@ -0,0 +1,230 @@ +// Copyright (c) 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 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 rule sets. + */ + @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 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 rule sets. + */ + @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 CDN 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); + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + 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 CDN 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) + SyncPoller, RuleSetInner> beginCreate( + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RuleSetInner> beginCreate( + 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 CDN 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); + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuleSetInner create(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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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 CDN 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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + @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..14f54f38903b4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/RulesClient.java @@ -0,0 +1,309 @@ +// Copyright (c) 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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); + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, String ruleName, 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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..a097bb3669743 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecretsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) 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; +import com.azure.resourcemanager.cdn.generated.models.SecretProperties; + +/** 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 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 secrets. + */ + @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 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 secrets. + */ + @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 CDN 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); + + /** + * Gets an existing Secret within a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String secretName, 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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); + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + SyncPoller, SecretInner> beginUpdate( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties); + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + SyncPoller, SecretInner> beginUpdate( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context); + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 update( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties); + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 update( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context); + + /** + * Deletes an existing Secret within 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN 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..3b7827dc35973 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/SecurityPoliciesClient.java @@ -0,0 +1,287 @@ +// Copyright (c) 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.SecurityPolicyProperties; + +/** 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 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 security policies. + */ + @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 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 security policies. + */ + @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 CDN 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); + + /** + * Gets an existing security policy within a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties); + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties, + Context context); + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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, + SecurityPolicyProperties securityPolicyProperties); + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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, + SecurityPolicyProperties securityPolicyProperties, + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 securityPolicyName); + + /** + * Deletes an existing security policy within 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 securityPolicyName 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 securityPolicyName, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ValidatesClient.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ValidatesClient.java new file mode 100644 index 0000000000000..e163968a1e626 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/ValidatesClient.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.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.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; + +/** An instance of this class provides access to all the operations defined in ValidatesClient. */ +public interface ValidatesClient { + /** + * Validate a Secret in the profile. + * + * @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 secret(ValidateSecretInput validateSecretInput); + + /** + * Validate a Secret in the profile. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response secretWithResponse(ValidateSecretInput validateSecretInput, 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..5d7b7aeafdaaa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdDomainInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +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.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class AfdDomainInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainInner.class); + + /* + * 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 = "properties.tlsSettings") + private AfdDomainHttpsParameters tlsSettings; + + /* + * Resource reference to the Azure DNS zone + */ + @JsonProperty(value = "properties.azureDnsZone") + private ResourceReference azureDnsZone; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Provisioning substate shows the progress of custom HTTPS + * enabling/disabling process step by step. DCV stands for + * DomainControlValidation. + */ + @JsonProperty(value = "properties.domainValidationState", access = JsonProperty.Access.WRITE_ONLY) + private DomainValidationState domainValidationState; + + /* + * The host name of the domain. Must be a domain name. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /* + * Values the customer needs to validate domain ownership + */ + @JsonProperty(value = "properties.validationProperties", access = JsonProperty.Access.WRITE_ONLY) + private DomainValidationProperties validationProperties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 AfdDomainInner object itself. + */ + public AfdDomainInner 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 AfdDomainInner object itself. + */ + public AfdDomainInner withAzureDnsZone(ResourceReference azureDnsZone) { + this.azureDnsZone = azureDnsZone; + 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; + } + + /** + * 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 AfdDomainInner object itself. + */ + public AfdDomainInner withHostname(String hostname) { + this.hostname = hostname; + 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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 (validationProperties() != null) { + validationProperties().validate(); + } + if (systemData() != null) { + systemData().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..24ce1567e359b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdEndpointInner.java @@ -0,0 +1,171 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +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.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 AzureFrontDoor endpoint uses the URL format + * <endpointname>.azureedge.net. + */ +@JsonFlatten +@Fluent +public class AfdEndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointInner.class); + + /* + * Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + */ + @JsonProperty(value = "properties.originResponseTimeoutSeconds") + private Integer originResponseTimeoutSeconds; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private EnabledState enabledState; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, + * e.g. contoso.azureedge.net + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 AfdEndpointInner object itself. + */ + public AfdEndpointInner withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + 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 AfdEndpointInner object itself. + */ + public AfdEndpointInner withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + 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; + } + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().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..913d828f1fc2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.ResponseBasedOriginErrorDetectionParameters; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 + * CDN. + */ +@JsonFlatten +@Fluent +public class AfdOriginGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupInner.class); + + /* + * Load balancing settings for a backend pool + */ + @JsonProperty(value = "properties.loadBalancingSettings") + private LoadBalancingSettingsParameters loadBalancingSettings; + + /* + * Health probe settings to the origin that is used to determine the health + * of the origin. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.responseBasedAfdOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings; + + /* + * Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.sessionAffinityState") + private EnabledState sessionAffinityState; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner 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 AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner 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 AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = + trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedAfdOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings() { + return this.responseBasedAfdOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedAfdOriginErrorDetectionSettings the responseBasedAfdOriginErrorDetectionSettings value to + * set. + * @return the AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings) { + this.responseBasedAfdOriginErrorDetectionSettings = responseBasedAfdOriginErrorDetectionSettings; + 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 AfdOriginGroupInner object itself. + */ + public AfdOriginGroupInner withSessionAffinityState(EnabledState sessionAffinityState) { + this.sessionAffinityState = sessionAffinityState; + 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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(); + } + if (responseBasedAfdOriginErrorDetectionSettings() != null) { + responseBasedAfdOriginErrorDetectionSettings().validate(); + } + if (systemData() != null) { + systemData().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..41ff3d4b0ef82 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/AfdOriginInner.java @@ -0,0 +1,347 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class AfdOriginInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginInner.class); + + /* + * Resource reference to the Azure origin resource. + */ + @JsonProperty(value = "properties.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 = "properties.hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000 + */ + @JsonProperty(value = "properties.weight") + private Integer weight; + + /* + * The properties of the private link resource for private origin. + */ + @JsonProperty(value = "properties.sharedPrivateLinkResource") + private Object 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 = "properties.enabledState") + private EnabledState enabledState; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 AfdOriginInner object itself. + */ + public AfdOriginInner 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 Object 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 AfdOriginInner object itself. + */ + public AfdOriginInner withSharedPrivateLinkResource(Object 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 AfdOriginInner object itself. + */ + public AfdOriginInner withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureOrigin() != null) { + azureOrigin().validate(); + } + if (systemData() != null) { + systemData().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..1bae5cf918f41 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CdnWebApplicationFirewallPolicyInner.java @@ -0,0 +1,300 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +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.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines web application firewall policy for Azure CDN. */ +@JsonFlatten +@Fluent +public class CdnWebApplicationFirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnWebApplicationFirewallPolicyInner.class); + + /* + * 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; + + /* + * Describes policySettings for policy + */ + @JsonProperty(value = "properties.policySettings") + private PolicySettings policySettings; + + /* + * Describes rate limit rules inside the policy. + */ + @JsonProperty(value = "properties.rateLimitRules") + private RateLimitRuleList rateLimitRules; + + /* + * Describes custom rules inside the policy. + */ + @JsonProperty(value = "properties.customRules") + private CustomRuleList customRules; + + /* + * Describes managed rules inside the policy. + */ + @JsonProperty(value = "properties.managedRules") + private ManagedRuleSetList managedRules; + + /* + * Describes Azure CDN endpoints associated with this Web Application + * Firewall policy. + */ + @JsonProperty(value = "properties.endpointLinks", access = JsonProperty.Access.WRITE_ONLY) + private List endpointLinks; + + /* + * Provisioning state of the WebApplicationFirewallPolicy. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private PolicyResourceState resourceState; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 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 CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner 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 CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner 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 CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner 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 CdnWebApplicationFirewallPolicyInner object itself. + */ + public CdnWebApplicationFirewallPolicyInner 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 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; + } + + /** + * 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; + } + + /** + * 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 CdnWebApplicationFirewallPolicyInner")); + } else { + sku().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()); + } + if (systemData() != null) { + systemData().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..9073698b836fb --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check name availability API. */ +@Immutable +public final class CheckNameAvailabilityOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityOutputInner.class); + + /* + * 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; + + /** + * 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..8a191d66be346 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseContinentsItem; +import com.azure.resourcemanager.cdn.generated.models.ContinentsResponseCountryOrRegionsItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Continents Response. */ +@Fluent +public final class ContinentsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinentsResponseInner.class); + + /* + * The continents property. + */ + @JsonProperty(value = "continents") + private List continents; + + /* + * The countryOrRegions property. + */ + @JsonProperty(value = "countryOrRegions") + private List countryOrRegions; + + /** + * 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..6b8fa738ac0e7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/CustomDomainInner.java @@ -0,0 +1,172 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class CustomDomainInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainInner.class); + + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /* + * Resource status of the custom domain. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomainResourceState resourceState; + + /* + * Provisioning status of Custom Https of the custom domain. + */ + @JsonProperty(value = "properties.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 = "properties.customHttpsProvisioningSubstate", access = JsonProperty.Access.WRITE_ONLY) + private CustomHttpsProvisioningSubstate customHttpsProvisioningSubstate; + + /* + * 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 = "properties.validationData") + private String validationData; + + /* + * Provisioning status of the custom domain. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData 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.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) { + 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 Custom Https 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 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 CustomDomainInner object itself. + */ + public CustomDomainInner withValidationData(String validationData) { + this.validationData = validationData; + return this; + } + + /** + * Get the provisioningState property: Provisioning status of the custom domain. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + } +} 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..a01d43fd73618 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EdgeNodeInner.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.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.IpAddressGroup; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. */ +@JsonFlatten +@Fluent +public class EdgeNodeInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgeNodeInner.class); + + /* + * List of ip address groups. + */ + @JsonProperty(value = "properties.ipAddressGroups") + private List ipAddressGroups; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 EdgeNodeInner object itself. + */ + public EdgeNodeInner withIpAddressGroups(List ipAddressGroups) { + this.ipAddressGroups = ipAddressGroups; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressGroups() != null) { + ipAddressGroups().forEach(e -> e.validate()); + } + if (systemData() != null) { + systemData().validate(); + } + } +} 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..1099d74709807 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/EndpointInner.java @@ -0,0 +1,619 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +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.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.SystemData; +import com.azure.resourcemanager.cdn.generated.models.UrlSigningKey; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class EndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointInner.class); + + /* + * A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "properties.originPath") + private String originPath; + + /* + * List of content types on which compression applies. The value should be + * a valid MIME type. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.geoFilters") + private List geoFilters; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "properties.defaultOriginGroup") + private ResourceReference defaultOriginGroup; + + /* + * List of keys used to validate the signed URL hashes. + */ + @JsonProperty(value = "properties.urlSigningKeys") + private List urlSigningKeys; + + /* + * A policy that specifies the delivery rules to be used for an endpoint. + */ + @JsonProperty(value = "properties.deliveryPolicy") + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /* + * Defines the Web Application Firewall policy for the endpoint (if + * applicable) + */ + @JsonProperty(value = "properties.webApplicationFirewallPolicyLink") + private EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /* + * The host name of the endpoint structured as {endpointName}.{DNSZone}, + * e.g. contoso.azureedge.net + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The source of the content being delivered via CDN. + */ + @JsonProperty(value = "properties.origins") + private List origins; + + /* + * The origin groups comprising of origins that are used for load balancing + * the traffic based on availability. + */ + @JsonProperty(value = "properties.originGroups") + private List originGroups; + + /* + * Resource status of the endpoint. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private EndpointResourceState resourceState; + + /* + * Provisioning status of the endpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner withWebApplicationFirewallPolicyLink( + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink) { + this.webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink; + 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.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 EndpointInner object itself. + */ + public EndpointInner 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 EndpointInner object itself. + */ + public EndpointInner withOriginGroups(List originGroups) { + this.originGroups = originGroups; + return this; + } + + /** + * 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 String provisioningState() { + return this.provisioningState; + } + + /** + * 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; + } + + /** + * 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(); + } + if (origins() != null) { + origins().forEach(e -> e.validate()); + } + if (originGroups() != null) { + originGroups().forEach(e -> e.validate()); + } + if (systemData() != null) { + systemData().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..caef3b9471a79 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ManagedRuleSetDefinitionInner.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.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.ManagedRuleGroupDefinition; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a managed rule set definition. */ +@JsonFlatten +@Fluent +public class ManagedRuleSetDefinitionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetDefinitionInner.class); + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the + * CdnWebApplicationFirewallPolicy. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Provisioning state of the managed rule set. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Type of the managed rule set. + */ + @JsonProperty(value = "properties.ruleSetType", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetType; + + /* + * Version of the managed rule set type. + */ + @JsonProperty(value = "properties.ruleSetVersion", access = JsonProperty.Access.WRITE_ONLY) + private String ruleSetVersion; + + /* + * Rule groups of the managed rule set. + */ + @JsonProperty(value = "properties.ruleGroups", access = JsonProperty.Access.WRITE_ONLY) + private List ruleGroups; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + if (systemData() != null) { + systemData().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..8453cf2ae84ae --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseGranularity; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseSeriesItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Metrics Response. */ +@Fluent +public final class MetricsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricsResponseInner.class); + + /* + * 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 MetricsResponseGranularity granularity; + + /* + * The series property. + */ + @JsonProperty(value = "series") + private List series; + + /** + * 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 MetricsResponseGranularity 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(MetricsResponseGranularity 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/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..593a816508e49 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OperationInner.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CDN REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().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..8b151fc64ef90 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginGroupInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.HealthProbeParameters; +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.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class OriginGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupInner.class); + + /* + * Health probe settings to the origin that is used to determine the health + * of the origin. + */ + @JsonProperty(value = "properties.healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin + * group. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.responseBasedOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /* + * Resource status of the origin group. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private OriginGroupResourceState resourceState; + + /* + * Provisioning status of the origin group. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 OriginGroupInner object itself. + */ + public OriginGroupInner 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 OriginGroupInner object itself. + */ + public OriginGroupInner 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 OriginGroupInner object itself. + */ + public OriginGroupInner 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 OriginGroupInner object itself. + */ + public OriginGroupInner withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; + return this; + } + + /** + * 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 String provisioningState() { + return this.provisioningState; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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(); + } + if (systemData() != null) { + systemData().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..938420f88626b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/OriginInner.java @@ -0,0 +1,415 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class OriginInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginInner.class); + + /* + * 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 = "properties.hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000 + */ + @JsonProperty(value = "properties.weight") + private Integer weight; + + /* + * Origin is enabled for load balancing or not + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private' + */ + @JsonProperty(value = "properties.privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private' + */ + @JsonProperty(value = "properties.privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "properties.privateLinkLocation") + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to + * the Private Link. + */ + @JsonProperty(value = "properties.privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /* + * Resource status of the origin. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private OriginResourceState resourceState; + + /* + * Provisioning status of the origin. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The approval status for the connection to the Private Link + */ + @JsonProperty(value = "properties.privateEndpointStatus", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointStatus privateEndpointStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner 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 OriginInner object itself. + */ + public OriginInner withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + return this; + } + + /** + * 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 String 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().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..a30343126f3ec --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ProfileInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.ProfileResourceState; +import com.azure.resourcemanager.cdn.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and pricing tier. + */ +@JsonFlatten +@Fluent +public class ProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileInner.class); + + /* + * The pricing tier (defines a CDN provider, feature list and rate) of the + * CDN profile. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Resource status of the profile. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ProfileResourceState resourceState; + + /* + * Provisioning status of the profile. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Id of the frontdoor. + */ + @JsonProperty(value = "properties.frontdoorId", access = JsonProperty.Access.WRITE_ONLY) + private String frontdoorId; + + /** + * Get the sku property: The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. + * + * @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 CDN 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 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 String provisioningState() { + return this.provisioningState; + } + + /** + * Get the frontdoorId property: The Id of the frontdoor. + * + * @return the frontdoorId value. + */ + public String frontdoorId() { + return this.frontdoorId; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProfileInner withTags(Map tags) { + super.withTags(tags); + 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(); + } + } +} 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..5d33b1a6aa29a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.RankingsResponseTablesItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Rankings Response. */ +@Fluent +public final class RankingsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RankingsResponseInner.class); + + /* + * 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; + + /** + * 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..590a06a931f7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ResourceUsageInner.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of check resource usage API. */ +@Immutable +public final class ResourceUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUsageInner.class); + + /* + * 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 String 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; + + /** + * 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 String 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..21e77e3c6d4ef --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseCustomDomainsItem; +import com.azure.resourcemanager.cdn.generated.models.ResourcesResponseEndpointsItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resources Response. */ +@Fluent +public final class ResourcesResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourcesResponseInner.class); + + /* + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The customDomains property. + */ + @JsonProperty(value = "customDomains") + private List customDomains; + + /** + * 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..b2701554a9620 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RouteInner.java @@ -0,0 +1,422 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +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.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Friendly Routes name mapping to the any Routes or secret related information. */ +@JsonFlatten +@Fluent +public class RouteInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteInner.class); + + /* + * Domains referenced by this endpoint. + */ + @JsonProperty(value = "properties.customDomains") + private List customDomains; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "properties.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 = "properties.originPath") + private String originPath; + + /* + * rule sets referenced by this endpoint. + */ + @JsonProperty(value = "properties.ruleSets") + private List ruleSets; + + /* + * List of supported protocols for this route. + */ + @JsonProperty(value = "properties.supportedProtocols") + private List supportedProtocols; + + /* + * The route patterns of the rule. + */ + @JsonProperty(value = "properties.patternsToMatch") + private List patternsToMatch; + + /* + * compression settings. + */ + @JsonProperty(value = "properties.compressionSettings") + private Object compressionSettings; + + /* + * 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 = "properties.queryStringCachingBehavior") + private AfdQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + @JsonProperty(value = "properties.forwardingProtocol") + private ForwardingProtocol forwardingProtocol; + + /* + * whether this route will be linked to the default endpoint domain. + */ + @JsonProperty(value = "properties.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 = "properties.httpsRedirect") + private HttpsRedirect httpsRedirect; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private EnabledState enabledState; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + public Object compressionSettings() { + return this.compressionSettings; + } + + /** + * Set the compressionSettings property: compression settings. + * + * @param compressionSettings the compressionSettings value to set. + * @return the RouteInner object itself. + */ + public RouteInner withCompressionSettings(Object compressionSettings) { + this.compressionSettings = compressionSettings; + 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 AfdQueryStringCachingBehavior 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 RouteInner object itself. + */ + public RouteInner withQueryStringCachingBehavior(AfdQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner 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 RouteInner object itself. + */ + public RouteInner withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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 (systemData() != null) { + systemData().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..7794638146256 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Friendly Rules name mapping to the any Rules or secret related information. */ +@JsonFlatten +@Fluent +public class RuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleInner.class); + + /* + * 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 = "properties.order") + private Integer order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + @JsonProperty(value = "properties.conditions") + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule + * are satisfied. + */ + @JsonProperty(value = "properties.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 = "properties.matchProcessingBehavior") + private MatchProcessingBehavior matchProcessingBehavior; + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 RuleInner object itself. + */ + public RuleInner 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 RuleInner object itself. + */ + public RuleInner 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 RuleInner object itself. + */ + public RuleInner 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 RuleInner object itself. + */ + public RuleInner withMatchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) { + this.matchProcessingBehavior = matchProcessingBehavior; + 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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()); + } + if (systemData() != null) { + systemData().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..806b0d2f44871 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/RuleSetInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Friendly RuleSet name mapping to the any RuleSet or secret related information. */ +@JsonFlatten +@Immutable +public class RuleSetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleSetInner.class); + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().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..4f29b57c7e496 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecretInner.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.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Friendly Secret name mapping to the any Secret or secret related information. */ +@JsonFlatten +@Fluent +public class SecretInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretInner.class); + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * object which contains secret parameters + */ + @JsonProperty(value = "properties.parameters") + private SecretParameters parameters; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * 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 SecretInner object itself. + */ + public SecretInner withParameters(SecretParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + if (systemData() != null) { + systemData().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..55c6d684b21c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/SecurityPolicyInner.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.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyParameters; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SecurityPolicy association for AzureFrontDoor profile. */ +@JsonFlatten +@Fluent +public class SecurityPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPolicyInner.class); + + /* + * Provisioning status + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AfdProvisioningState provisioningState; + + /* + * The deploymentStatus property. + */ + @JsonProperty(value = "properties.deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentStatus deploymentStatus; + + /* + * object which contains security policy parameters + */ + @JsonProperty(value = "properties.parameters") + private SecurityPolicyParameters parameters; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyParameters parameters() { + return this.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(SecurityPolicyParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + if (systemData() != null) { + systemData().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..6ed8e2ea78808 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The URI required to login to the supplemental portal from the Azure portal. */ +@Immutable +public final class SsoUriInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsoUriInner.class); + + /* + * The URI used to login to the supplemental portal. + */ + @JsonProperty(value = "ssoUriValue", access = JsonProperty.Access.WRITE_ONLY) + private String ssoUriValue; + + /** + * 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..239309c196885 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.OptimizationType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of the GetSupportedOptimizationTypes API. */ +@Immutable +public final class SupportedOptimizationTypesListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedOptimizationTypesListResultInner.class); + + /* + * Supported optimization types for a profile. + */ + @JsonProperty(value = "supportedOptimizationTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedOptimizationTypes; + + /** + * 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..d7927ebfe863b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/UsageInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes resource usage. */ +@Fluent +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..5bee0329db098 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of custom domain validation. */ +@Immutable +public final class ValidateCustomDomainOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateCustomDomainOutputInner.class); + + /* + * 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; + + /** + * 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..3fd7a14a06755 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of the validate probe API. */ +@Immutable +public final class ValidateProbeOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateProbeOutputInner.class); + + /* + * 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; + + /** + * 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..3fd5c903dcb0c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Output of the validated secret. */ +@Fluent +public final class ValidateSecretOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateSecretOutputInner.class); + + /* + * The validation status. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Detailed error message + */ + @JsonProperty(value = "message") + private String message; + + /** + * 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/ValidationTokenInner.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidationTokenInner.java new file mode 100644 index 0000000000000..fa2bea4c3285e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/fluent/models/ValidationTokenInner.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The validation token. */ +@Immutable +public final class ValidationTokenInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationTokenInner.class); + + /* + * The token property. + */ + @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) + private String token; + + /** + * Get the token property: The token property. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * 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..13dbd2b139112 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseGranularity; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseSeriesItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Waf Metrics Response. */ +@Fluent +public final class WafMetricsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WafMetricsResponseInner.class); + + /* + * 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 WafMetricsResponseGranularity granularity; + + /* + * The series property. + */ + @JsonProperty(value = "series") + private List series; + + /** + * 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 WafMetricsResponseGranularity 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(WafMetricsResponseGranularity 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..325b7c7d9d3dc --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.models.WafRankingsResponseDataItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Waf Rankings Response. */ +@Fluent +public final class WafRankingsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WafRankingsResponseInner.class); + + /* + * 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; + + /** + * 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..b2297906df4a4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsClientImpl.java @@ -0,0 +1,1787 @@ +// Copyright (c) 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.logging.ClientLogger; +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.fluent.models.ValidationTokenInner; +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 { + private final ClientLogger logger = new ClientLogger(AfdCustomDomainsClientImpl.class); + + /** 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}) + @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 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 domains. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists existing AzureFrontDoor domains. + * + * @param resourceGroupName 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 domains. + */ + @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 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 domains. + */ + @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 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 domains. + */ + @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 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 domains. + */ + @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 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 domains. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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) + private Mono getAsync(String resourceGroupName, String profileName, String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN 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 getAsync(resourceGroupName, profileName, customDomainName).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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, customDomainName, context).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 CDN 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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. + */ + @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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Creates a new domain within the specified 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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. + */ + @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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Updates an existing domain within a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 CDN 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 validation token. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 validation token. + */ + @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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ValidationTokenInner> beginRefreshValidationTokenAsync( + String resourceGroupName, String profileName, String customDomainName) { + Mono>> mono = + refreshValidationTokenWithResponseAsync(resourceGroupName, profileName, customDomainName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ValidationTokenInner.class, + ValidationTokenInner.class, + Context.NONE); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ValidationTokenInner> 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(), ValidationTokenInner.class, ValidationTokenInner.class, context); + } + + /** + * Updates the domain validation token. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ValidationTokenInner> 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ValidationTokenInner> 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 CDN 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 validation token. + */ + @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 CDN 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 validation token. + */ + @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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTokenInner refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName) { + return 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 CDN 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 validation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTokenInner refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context) { + return refreshValidationTokenAsync(resourceGroupName, profileName, customDomainName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..01c1c13ececa7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdCustomDomainsImpl.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.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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.AfdCustomDomainsClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidationTokenInner; +import com.azure.resourcemanager.cdn.generated.models.AfdCustomDomains; +import com.azure.resourcemanager.cdn.generated.models.AfdDomain; +import com.azure.resourcemanager.cdn.generated.models.ValidationToken; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AfdCustomDomainsImpl implements AfdCustomDomains { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdCustomDomainsImpl.class); + + private final AfdCustomDomainsClient innerClient; + + private final CdnManager serviceManager; + + public AfdCustomDomainsImpl(AfdCustomDomainsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new AfdDomainImpl(inner1, this.manager())); + } + + 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 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 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 ValidationToken refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName) { + ValidationTokenInner inner = + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName); + if (inner != null) { + return new ValidationTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidationToken refreshValidationToken( + String resourceGroupName, String profileName, String customDomainName, Context context) { + ValidationTokenInner inner = + this.serviceClient().refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + if (inner != null) { + return new ValidationTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 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..b45cd67dde438 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdDomainImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.azure.resourcemanager.cdn.generated.models.ValidationToken; + +public final class AfdDomainImpl implements AfdDomain, AfdDomain.Definition, AfdDomain.Update { + private AfdDomainInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AfdDomainHttpsParameters tlsSettings() { + return this.innerModel().tlsSettings(); + } + + public ResourceReference azureDnsZone() { + return this.innerModel().azureDnsZone(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public DomainValidationState domainValidationState() { + return this.innerModel().domainValidationState(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public DomainValidationProperties validationProperties() { + return this.innerModel().validationProperties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdDomainInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 ValidationToken refreshValidationToken() { + return serviceManager + .afdCustomDomains() + .refreshValidationToken(resourceGroupName, profileName, customDomainName); + } + + public ValidationToken refreshValidationToken(Context context) { + return serviceManager + .afdCustomDomains() + .refreshValidationToken(resourceGroupName, profileName, customDomainName, context); + } + + 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 withHostname(String hostname) { + this.innerModel().withHostname(hostname); + 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..8da95711d38c8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointImpl.java @@ -0,0 +1,258 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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.DeploymentStatus; +import com.azure.resourcemanager.cdn.generated.models.EnabledState; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +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 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 Integer originResponseTimeoutSeconds() { + return this.innerModel().originResponseTimeoutSeconds(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AfdEndpointInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager + .afdEndpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager + .afdEndpoints() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + } + + 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 withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + if (isInCreateMode()) { + this.innerModel().withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } else { + this.updateEndpointUpdateProperties.withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + 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..a16f3ce874437 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsClientImpl.java @@ -0,0 +1,2363 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(AfdEndpointsClientImpl.class); + + /** 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists existing AzureFrontDoor 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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. + */ + @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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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 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 getAsync(resourceGroupName, profileName, endpointName).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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint) { + 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 (endpoint == null) { + return Mono.error(new IllegalArgumentException("Parameter endpoint is required and cannot be null.")); + } else { + endpoint.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpoint, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, 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 (endpoint == null) { + return Mono.error(new IllegalArgumentException("Parameter endpoint is required and cannot be null.")); + } else { + endpoint.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(), + endpoint, + 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private PollerFlux, AfdEndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpoint); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AfdEndpointInner.class, AfdEndpointInner.class, Context.NONE); + } + + /** + * 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private PollerFlux, AfdEndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpoint, 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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 SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint).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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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 SyncPoller, AfdEndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint, 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint) + .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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint, 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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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 AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint) { + return createAsync(resourceGroupName, profileName, endpointName, endpoint).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 CDN profile which is unique within the resource group. + * @param endpointName Name of the endpoint under the profile which is unique globally. + * @param endpoint 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 AfdEndpointInner create( + String resourceGroupName, String profileName, String endpointName, AfdEndpointInner endpoint, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpoint, 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 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 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) + 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 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) + 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, Context.NONE); + } + + /** + * 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 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) + 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 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 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 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 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 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) + 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 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) + 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 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 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 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 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 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 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 completion. + */ + @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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 completion. + */ + @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 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 completion. + */ + @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 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 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 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(); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 CDN 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 list usages operation response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateCustomDomainAsync(resourceGroupName, profileName, endpointName, customDomainProperties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..dfc6f3773d6c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdEndpointsImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) 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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AfdEndpointsImpl implements AfdEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointsImpl.class); + + private final AfdEndpointsClient innerClient; + + private final CdnManager serviceManager; + + public AfdEndpointsImpl(AfdEndpointsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new AfdEndpointImpl(inner1, this.manager())); + } + + 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 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 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 inner.mapPage(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 inner.mapPage(inner1 -> new UsageImpl(inner1, this.manager())); + } + + 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 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 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 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..ccac215e3ea12 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupImpl.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.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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.ResponseBasedOriginErrorDetectionParameters; +import com.azure.resourcemanager.cdn.generated.models.SystemData; +import com.azure.resourcemanager.cdn.generated.models.Usage; + +public final class AfdOriginGroupImpl implements AfdOriginGroup, AfdOriginGroup.Definition, AfdOriginGroup.Update { + private AfdOriginGroupInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LoadBalancingSettingsParameters loadBalancingSettings() { + return this.innerModel().loadBalancingSettings(); + } + + public HealthProbeParameters healthProbeSettings() { + return this.innerModel().healthProbeSettings(); + } + + public Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes() { + return this.innerModel().trafficRestorationTimeToHealedOrNewEndpointsInMinutes(); + } + + public ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings() { + return this.innerModel().responseBasedAfdOriginErrorDetectionSettings(); + } + + public EnabledState sessionAffinityState() { + return this.innerModel().sessionAffinityState(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdOriginGroupInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings) { + if (isInCreateMode()) { + this + .innerModel() + .withResponseBasedAfdOriginErrorDetectionSettings(responseBasedAfdOriginErrorDetectionSettings); + return this; + } else { + this + .updateOriginGroupUpdateProperties + .withResponseBasedAfdOriginErrorDetectionSettings(responseBasedAfdOriginErrorDetectionSettings); + 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..0eec09dee3d36 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsClientImpl.java @@ -0,0 +1,1790 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(AfdOriginGroupsClientImpl.class); + + /** 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 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 origin groups. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 origin groups. + */ + @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 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 origin groups. + */ + @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 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 origin groups. + */ + @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 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 origin groups. + */ + @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 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 origin groups. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an existing origin group within a 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 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. + */ + @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 CDN 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) + private Mono getAsync(String resourceGroupName, String profileName, String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an existing origin group within a 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 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 getAsync(resourceGroupName, profileName, originGroupName).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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, context).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 CDN 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 CDN. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * Updates an existing origin group within a 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 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 CDN. + */ + @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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Deletes an existing origin group within a 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..55ce966d9c889 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginGroupsImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AfdOriginGroupsImpl implements AfdOriginGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupsImpl.class); + + private final AfdOriginGroupsClient innerClient; + + private final CdnManager serviceManager; + + public AfdOriginGroupsImpl(AfdOriginGroupsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new AfdOriginGroupImpl(inner1, this.manager())); + } + + 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 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 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 inner.mapPage(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 inner.mapPage(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 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..4c27a83fcf25d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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.SystemData; + +public final class AfdOriginImpl implements AfdOrigin, AfdOrigin.Definition, AfdOrigin.Update { + private AfdOriginInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 Object sharedPrivateLinkResource() { + return this.innerModel().sharedPrivateLinkResource(); + } + + public EnabledState enabledState() { + return this.innerModel().enabledState(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AfdOriginInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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(Object 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; + } + } + + 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..407a727cac2a5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsClientImpl.java @@ -0,0 +1,1593 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(AfdOriginsClientImpl.class); + + /** 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 CDN 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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. + */ + @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 CDN 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) + private Mono getAsync( + String resourceGroupName, String profileName, String originGroupName, String originName) { + return getWithResponseAsync(resourceGroupName, profileName, originGroupName, originName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 getAsync(resourceGroupName, profileName, originGroupName, originName).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 CDN 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. + */ + @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(); + } + + /** + * 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Updates an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 cDN origin is the source of the content being delivered via CDN. + */ + @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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Deletes an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..1d147a602f69a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdOriginsImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AfdOriginsImpl implements AfdOrigins { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginsImpl.class); + + private final AfdOriginsClient innerClient; + + private final CdnManager serviceManager; + + public AfdOriginsImpl(AfdOriginsClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new AfdOriginImpl(inner1, this.manager())); + } + + 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 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 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 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..6f2e5c9503a17 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesClientImpl.java @@ -0,0 +1,540 @@ +// Copyright (c) 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +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.UsagesListResult; +import com.azure.resourcemanager.cdn.generated.models.ValidateCustomDomainInput; +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 { + private final ClientLogger logger = new ClientLogger(AfdProfilesClientImpl.class); + + /** 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") ValidateCustomDomainInput checkHostnameAvailabilityInput, + @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 CDN 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 list usages operation response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 CDN 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 list usages operation response. + */ + @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 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, String profileName, ValidateCustomDomainInput 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkHostnameAvailabilityWithResponseAsync( + String resourceGroupName, + String profileName, + ValidateCustomDomainInput 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 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkHostnameAvailabilityAsync( + String resourceGroupName, String profileName, ValidateCustomDomainInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityWithResponseAsync( + resourceGroupName, profileName, checkHostnameAvailabilityInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateCustomDomainOutputInner checkHostnameAvailability( + String resourceGroupName, String profileName, ValidateCustomDomainInput checkHostnameAvailabilityInput) { + return checkHostnameAvailabilityAsync(resourceGroupName, profileName, checkHostnameAvailabilityInput).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 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 custom domain validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + ValidateCustomDomainInput checkHostnameAvailabilityInput, + Context context) { + return checkHostnameAvailabilityWithResponseAsync( + resourceGroupName, profileName, checkHostnameAvailabilityInput, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..dcc1e416fd3e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/AfdProfilesImpl.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.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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.AfdProfilesClient; +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.AfdProfiles; +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 com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AfdProfilesImpl implements AfdProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdProfilesImpl.class); + + private final AfdProfilesClient innerClient; + + private final CdnManager serviceManager; + + public AfdProfilesImpl(AfdProfilesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new UsageImpl(inner1, this.manager())); + } + + public ValidateCustomDomainOutput checkHostnameAvailability( + String resourceGroupName, String profileName, ValidateCustomDomainInput checkHostnameAvailabilityInput) { + ValidateCustomDomainOutputInner inner = + this + .serviceClient() + .checkHostnameAvailability(resourceGroupName, profileName, checkHostnameAvailabilityInput); + if (inner != null) { + return new ValidateCustomDomainOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + ValidateCustomDomainInput 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 ValidateCustomDomainOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AfdProfilesClient serviceClient() { + return this.innerClient; + } + + private 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..d364492e5831b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientBuilder.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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the 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 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 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 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() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + CdnManagementClientImpl client = + new CdnManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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..92f924da80107 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnManagementClientImpl.java @@ -0,0 +1,601 @@ +// Copyright (c) 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.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 com.azure.resourcemanager.cdn.generated.fluent.ValidatesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the CdnManagementClientImpl type. */ +@ServiceClient(builder = CdnManagementClientBuilder.class) +public final class CdnManagementClientImpl implements CdnManagementClient { + private final ClientLogger logger = new ClientLogger(CdnManagementClientImpl.class); + + /** 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 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 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 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 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 ValidatesClient object to access its operations. */ + private final ValidatesClient validates; + + /** + * Gets the ValidatesClient object to access its operations. + * + * @return the ValidatesClient object. + */ + public ValidatesClient getValidates() { + return this.validates; + } + + /** 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 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 = "2020-09-01"; + 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.resourceProviders = new ResourceProvidersClientImpl(this); + this.resourceUsages = new ResourceUsagesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.edgeNodes = new EdgeNodesClientImpl(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.validates = new ValidatesClientImpl(this); + this.logAnalytics = new LogAnalyticsClientImpl(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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException 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.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/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..08c56846ac011 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CdnWebApplicationFirewallPolicyImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +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 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 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PolicyResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CdnWebApplicationFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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; + } + + 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/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..fde6d97f84dcd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CheckNameAvailabilityOutputImpl.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.CdnManager; +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 CdnManager serviceManager; + + CheckNameAvailabilityOutputImpl(CheckNameAvailabilityOutputInner innerObject, 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 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..1e57a0165feaf --- /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.CdnManager; +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 CdnManager serviceManager; + + ContinentsResponseImpl(ContinentsResponseInner innerObject, 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 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..96415aac1bd33 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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; +import com.azure.resourcemanager.cdn.generated.models.SystemData; + +public final class CustomDomainImpl implements CustomDomain, CustomDomain.Definition { + private CustomDomainInner innerObject; + + private final CdnManager serviceManager; + + CustomDomainImpl(CustomDomainInner innerObject, 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 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 String validationData() { + return this.innerModel().validationData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CustomDomainInner innerModel() { + return this.innerObject; + } + + private 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, 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 Response disableCustomHttpsWithResponse(Context context) { + return serviceManager + .customDomains() + .disableCustomHttpsWithResponse(resourceGroupName, profileName, endpointName, customDomainName, context); + } + + public CustomDomain enableCustomHttps() { + return serviceManager + .customDomains() + .enableCustomHttps(resourceGroupName, profileName, endpointName, customDomainName); + } + + public Response enableCustomHttpsWithResponse( + CustomDomainHttpsParameters customDomainHttpsParameters, Context context) { + return serviceManager + .customDomains() + .enableCustomHttpsWithResponse( + 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..d19768d773d1f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsClientImpl.java @@ -0,0 +1,1713 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(CustomDomainsClientImpl.class); + + /** 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, profileName, endpointName, customDomainName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e. + */ + @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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, + * e. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 response. + */ + @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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) + 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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 the response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 response. + */ + @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + return disableCustomHttpsWithResponseAsync(resourceGroupName, profileName, endpointName, customDomainName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 response. + */ + @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableCustomHttpsWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + return disableCustomHttpsWithResponseAsync( + 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 the response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 response. + */ + @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters) { + return enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableCustomHttpsAsync( + String resourceGroupName, String profileName, String endpointName, String customDomainName) { + final CustomDomainHttpsParameters customDomainHttpsParameters = null; + return enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 response. + */ + @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableCustomHttpsWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + return enableCustomHttpsWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainName, customDomainHttpsParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..c467328a8659d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/CustomDomainsImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) 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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomDomainsImpl implements CustomDomains { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainsImpl.class); + + private final CustomDomainsClient innerClient; + + private final CdnManager serviceManager; + + public CustomDomainsImpl(CustomDomainsClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + 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 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 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 Response disableCustomHttpsWithResponse( + String resourceGroupName, String profileName, String endpointName, String customDomainName, Context context) { + Response inner = + this + .serviceClient() + .disableCustomHttpsWithResponse( + 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 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 Response enableCustomHttpsWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + String customDomainName, + CustomDomainHttpsParameters customDomainHttpsParameters, + Context context) { + Response inner = + this + .serviceClient() + .enableCustomHttpsWithResponse( + resourceGroupName, + profileName, + endpointName, + customDomainName, + customDomainHttpsParameters, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainImpl(inner.getValue(), 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 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..7f04ba61642c4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodeImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) 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.CdnManager; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class EdgeNodeImpl implements EdgeNode { + private EdgeNodeInner innerObject; + + private final CdnManager serviceManager; + + EdgeNodeImpl(EdgeNodeInner innerObject, 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 List ipAddressGroups() { + List inner = this.innerModel().ipAddressGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EdgeNodeInner innerModel() { + return this.innerObject; + } + + private 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..ab77e9eba1e25 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(EdgeNodesClientImpl.class); + + /** 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..d4a79dedf911f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EdgeNodesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EdgeNodesImpl implements EdgeNodes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgeNodesImpl.class); + + private final EdgeNodesClient innerClient; + + private final CdnManager serviceManager; + + public EdgeNodesImpl(EdgeNodesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new EdgeNodeImpl(inner1, this.manager())); + } + + private EdgeNodesClient serviceClient() { + return this.innerClient; + } + + private 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..6e449e6681642 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointImpl.java @@ -0,0 +1,505 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +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.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.SystemData; +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 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 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 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 EndpointResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public EndpointInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 ValidateCustomDomainOutput validateCustomDomain(ValidateCustomDomainInput customDomainProperties) { + return serviceManager + .endpoints() + .validateCustomDomain(resourceGroupName, profileName, endpointName, customDomainProperties); + } + + public Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context) { + return serviceManager + .endpoints() + .validateCustomDomainWithResponse( + resourceGroupName, profileName, endpointName, customDomainProperties, context); + } + + 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 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; + } + } + + public EndpointImpl withOrigins(List origins) { + this.innerModel().withOrigins(origins); + return this; + } + + public EndpointImpl withOriginGroups(List originGroups) { + this.innerModel().withOriginGroups(originGroups); + 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..c270ffae32d23 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsClientImpl.java @@ -0,0 +1,3255 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(EndpointsClientImpl.class); + + /** 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({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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String profileName, String endpointName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, profileName, endpointName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, context).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 endpoint 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + 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 (endpoint == null) { + return Mono.error(new IllegalArgumentException("Parameter endpoint is required and cannot be null.")); + } else { + endpoint.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + profileName, + endpointName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + endpoint, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 endpoint 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, 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 (endpoint == null) { + return Mono.error(new IllegalArgumentException("Parameter endpoint is required and cannot be null.")); + } else { + endpoint.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(), + endpoint, + 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 endpoint 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) + private PollerFlux, EndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpoint); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), EndpointInner.class, EndpointInner.class, Context.NONE); + } + + /** + * 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 endpoint 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) + private PollerFlux, EndpointInner> beginCreateAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, endpointName, endpoint, 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 endpoint 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 SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint).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 endpoint 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 SyncPoller, EndpointInner> beginCreate( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint, 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 endpoint 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) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint) + .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 endpoint 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) + private Mono createAsync( + String resourceGroupName, String profileName, String endpointName, EndpointInner endpoint, Context context) { + return beginCreateAsync(resourceGroupName, profileName, endpointName, endpoint, 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 endpoint 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 endpoint) { + return createAsync(resourceGroupName, profileName, endpointName, endpoint).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 endpoint 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 endpoint, Context context) { + return createAsync(resourceGroupName, profileName, endpointName, endpoint, 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 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) + 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 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) + 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, Context.NONE); + } + + /** + * 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) + 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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 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) + 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 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) + 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, Context.NONE); + } + + /** + * 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) + 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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 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) + 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 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) + 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, Context.NONE); + } + + /** + * 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) + 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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the completion. + */ + @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 the completion. + */ + @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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the completion. + */ + @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 the completion. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateCustomDomainAsync( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateCustomDomainAsync(resourceGroupName, profileName, endpointName, customDomainProperties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context) { + return validateCustomDomainWithResponseAsync( + resourceGroupName, profileName, endpointName, customDomainProperties, context) + .block(); + } + + /** + * 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..1c02c3543678b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/EndpointsImpl.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.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EndpointsImpl implements Endpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointsImpl.class); + + private final EndpointsClient innerClient; + + private final CdnManager serviceManager; + + public EndpointsImpl(EndpointsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new EndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new EndpointImpl(inner1, this.manager())); + } + + 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 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 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 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 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 PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, endpointName); + return inner.mapPage(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 inner.mapPage(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 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..d86823ccefc6b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsClientImpl.java @@ -0,0 +1,1950 @@ +// Copyright (c) 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.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +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.List; +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 { + private final ClientLogger logger = new ClientLogger(LogAnalyticsClientImpl.class); + + /** 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("metrics") String metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") LogMetricsGranularity granularity, + @QueryParam("groupBy") String groupBy, + @QueryParam("continents") String continents, + @QueryParam("countryOrRegions") String countryOrRegions, + @QueryParam("customDomains") String customDomains, + @QueryParam("protocols") String 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("rankings") String rankings, + @QueryParam("metrics") String metrics, + @QueryParam("maxRanking") int maxRanking, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("customDomains") String 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("metrics") String metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("granularity") WafGranularity granularity, + @QueryParam("actions") String actions, + @QueryParam("groupBy") String groupBy, + @QueryParam("ruleTypes") String 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("metrics") String metrics, + @QueryParam("dateTimeBegin") OffsetDateTime dateTimeBegin, + @QueryParam("dateTimeEnd") OffsetDateTime dateTimeEnd, + @QueryParam("maxRanking") int maxRanking, + @QueryParam("rankings") String rankings, + @QueryParam("actions") String actions, + @QueryParam("ruleTypes") String 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 CDN profile 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String groupByConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(groupBy, CollectionFormat.CSV); + String continentsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(continents, CollectionFormat.CSV); + String countryOrRegionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(countryOrRegions, CollectionFormat.CSV); + String customDomainsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(customDomains, CollectionFormat.CSV); + String protocolsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(protocols, CollectionFormat.CSV); + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get log report for AFD 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 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String groupByConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(groupBy, CollectionFormat.CSV); + String continentsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(continents, CollectionFormat.CSV); + String countryOrRegionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(countryOrRegions, CollectionFormat.CSV); + String customDomainsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(customDomains, CollectionFormat.CSV); + String protocolsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(protocols, CollectionFormat.CSV); + 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 CDN profile 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsMetricsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + LogMetricsGranularity granularity, + List customDomains, + List protocols, + List groupBy, + List continents, + List countryOrRegions) { + return getLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get log report for AFD 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 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) + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get log report for AFD 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 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 getLogAnalyticsMetricsAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + customDomains, + protocols, + groupBy, + continents, + countryOrRegions) + .block(); + } + + /** + * Get log report for AFD 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 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. + */ + @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 analytics ranking report for AFD 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 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. + */ + @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"; + String rankingsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(rankings, CollectionFormat.CSV); + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String customDomainsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(customDomains, CollectionFormat.CSV); + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get log analytics ranking report for AFD 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 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. + */ + @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"; + String rankingsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(rankings, CollectionFormat.CSV); + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String customDomainsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(customDomains, CollectionFormat.CSV); + 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 CDN profile 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsRankingsAsync( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains) { + return getLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get log analytics ranking report for AFD 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 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) + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get log analytics ranking report for AFD 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 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 getLogAnalyticsRankingsAsync( + resourceGroupName, + profileName, + rankings, + metrics, + maxRanking, + dateTimeBegin, + dateTimeEnd, + customDomains) + .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 CDN profile 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. + */ + @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 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 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 all available location names for AFD log analytics report. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 all available location names for AFD log analytics report. + */ + @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 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 all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsLocationsAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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 all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContinentsResponseInner getLogAnalyticsLocations(String resourceGroupName, String profileName) { + return getLogAnalyticsLocationsAsync(resourceGroupName, profileName).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 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 all available location names for AFD log analytics report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsLocationsWithResponse( + String resourceGroupName, String profileName, Context context) { + return getLogAnalyticsLocationsWithResponseAsync(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 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 all endpoints and custom domains available for AFD log report. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 all endpoints and custom domains available for AFD log report. + */ + @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 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 all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogAnalyticsResourcesAsync(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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 all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourcesResponseInner getLogAnalyticsResources(String resourceGroupName, String profileName) { + return getLogAnalyticsResourcesAsync(resourceGroupName, profileName).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 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 all endpoints and custom domains available for AFD log report. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, Context context) { + return getLogAnalyticsResourcesWithResponseAsync(resourceGroupName, profileName, 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 CDN profile 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String actionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(actions, CollectionFormat.CSV); + String groupByConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(groupBy, CollectionFormat.CSV); + String ruleTypesConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(ruleTypes, CollectionFormat.CSV); + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN profile 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String actionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(actions, CollectionFormat.CSV); + String groupByConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(groupBy, CollectionFormat.CSV); + String ruleTypesConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(ruleTypes, CollectionFormat.CSV); + 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 CDN profile 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsMetricsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + List ruleTypes) { + return getWafLogAnalyticsMetricsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN profile 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) + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN profile 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 getWafLogAnalyticsMetricsAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + granularity, + actions, + groupBy, + ruleTypes) + .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 CDN profile 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. + */ + @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 log analytics charts for AFD 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 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String rankingsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(rankings, CollectionFormat.CSV); + String actionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(actions, CollectionFormat.CSV); + String ruleTypesConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(ruleTypes, CollectionFormat.CSV); + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get WAF log analytics charts for AFD 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 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. + */ + @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"; + String metricsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(metrics, CollectionFormat.CSV); + String rankingsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(rankings, CollectionFormat.CSV); + String actionsConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(actions, CollectionFormat.CSV); + String ruleTypesConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(ruleTypes, CollectionFormat.CSV); + 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 CDN profile 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWafLogAnalyticsRankingsAsync( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes) { + return getWafLogAnalyticsRankingsWithResponseAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get WAF log analytics charts for AFD 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 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) + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get WAF log analytics charts for AFD 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 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 getWafLogAnalyticsRankingsAsync( + resourceGroupName, + profileName, + metrics, + dateTimeBegin, + dateTimeEnd, + maxRanking, + rankings, + actions, + ruleTypes) + .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 CDN profile 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. + */ + @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(); + } +} 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..47d0d7c64dd66 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/LogAnalyticsImpl.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.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.CdnManager; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; +import java.util.List; + +public final class LogAnalyticsImpl implements LogAnalytics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsImpl.class); + + private final LogAnalyticsClient innerClient; + + private final CdnManager serviceManager; + + public LogAnalyticsImpl(LogAnalyticsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 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 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 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 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 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 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 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 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 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 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; + } + } + + 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; + } + } + + private LogAnalyticsClient serviceClient() { + return this.innerClient; + } + + private 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..7e6295af4b73f --- /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.resourcemanager.cdn.generated.CdnManager; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class ManagedRuleSetDefinitionImpl implements ManagedRuleSetDefinition { + private ManagedRuleSetDefinitionInner innerObject; + + private final CdnManager serviceManager; + + ManagedRuleSetDefinitionImpl(ManagedRuleSetDefinitionInner innerObject, 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 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedRuleSetDefinitionInner innerModel() { + return this.innerObject; + } + + private 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..d2d9f3dd73845 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(ManagedRuleSetsClientImpl.class); + + /** 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..859d3f15ca119 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ManagedRuleSetsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedRuleSetsImpl implements ManagedRuleSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetsImpl.class); + + private final ManagedRuleSetsClient innerClient; + + private final CdnManager serviceManager; + + public ManagedRuleSetsImpl(ManagedRuleSetsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ManagedRuleSetDefinitionImpl(inner1, this.manager())); + } + + private ManagedRuleSetsClient serviceClient() { + return this.innerClient; + } + + private 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..fb5c9572a7f56 --- /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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.MetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.MetricsResponseGranularity; +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 CdnManager serviceManager; + + MetricsResponseImpl(MetricsResponseInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public MetricsResponseGranularity 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 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..5170997da0300 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationImpl.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.CdnManager; +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; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final CdnManager serviceManager; + + OperationImpl(OperationInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private 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..d318025e807dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..2c80849ce9698 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final CdnManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private 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..9572505e2ba91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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.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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class OriginGroupImpl implements OriginGroup, OriginGroup.Definition, OriginGroup.Update { + private OriginGroupInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 OriginGroupResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginGroupInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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..39840b9098abe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsClientImpl.java @@ -0,0 +1,1620 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(OriginGroupsClientImpl.class); + + /** 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({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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String originGroupName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, profileName, endpointName, originGroupName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originGroupName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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) + 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 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 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 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 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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @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 origin group comprising of origins is used for load balancing to origins when the content cannot be + * served from CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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) + 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 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 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 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 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. + */ + @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. + */ + @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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the completion. + */ + @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 the completion. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..e5fe0a010870b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginGroupsImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OriginGroupsImpl implements OriginGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupsImpl.class); + + private final OriginGroupsClient innerClient; + + private final CdnManager serviceManager; + + public OriginGroupsImpl(OriginGroupsClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new OriginGroupImpl(inner1, this.manager())); + } + + 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 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 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 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..716c5d753d393 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginImpl.java @@ -0,0 +1,314 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.azure.resourcemanager.cdn.generated.models.Origin; +import com.azure.resourcemanager.cdn.generated.models.OriginResourceState; +import com.azure.resourcemanager.cdn.generated.models.OriginUpdateParameters; +import com.azure.resourcemanager.cdn.generated.models.PrivateEndpointStatus; +import com.azure.resourcemanager.cdn.generated.models.SystemData; + +public final class OriginImpl implements Origin, Origin.Definition, Origin.Update { + private OriginInner innerObject; + + private final 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 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 OriginResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointStatus privateEndpointStatus() { + return this.innerModel().privateEndpointStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OriginInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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..765d83a5d4c36 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsClientImpl.java @@ -0,0 +1,1561 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(OriginsClientImpl.class); + + /** 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({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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String originName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, profileName, endpointName, originName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse( + String resourceGroupName, String profileName, String endpointName, String originName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, originName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 cDN origin is the source of the content being delivered via CDN. + */ + @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 cDN origin is the source of the content being delivered via CDN. + */ + @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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 cDN origin is the source of the content being delivered via CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 the completion. + */ + @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 the completion. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..440cc772f9847 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/OriginsImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OriginsImpl implements Origins { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginsImpl.class); + + private final OriginsClient innerClient; + + private final CdnManager serviceManager; + + public OriginsImpl(OriginsClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new OriginImpl(inner1, this.manager())); + } + + 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 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 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 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..ee7e46618a891 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesClientImpl.java @@ -0,0 +1,1304 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(PoliciesClientImpl.class); + + /** 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({"Accept: application/json;q=0.9", "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, + 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getByResourceGroupAsync(resourceGroupName, policyName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 defines web application firewall policy for Azure CDN. + */ + @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 defines web application firewall policy for Azure CDN. + */ + @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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 defines web application firewall policy for Azure CDN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + */ + @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. + */ + @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 completion. + */ + @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.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 completion. + */ + @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.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + policyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String policyName) { + return deleteWithResponseAsync(resourceGroupName, policyName).flatMap((Response res) -> Mono.empty()); + } + + /** + * 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) { + deleteAsync(resourceGroupName, policyName).block(); + } + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String policyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..4d5cb644fcaa5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/PoliciesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PoliciesImpl implements Policies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesImpl.class); + + private final PoliciesClient innerClient; + + private final CdnManager serviceManager; + + public PoliciesImpl(PoliciesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new CdnWebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + 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 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 void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public Response deleteWithResponse(String resourceGroupName, String policyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, policyName, context); + } + + 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.deleteWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + 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.deleteWithResponse(resourceGroupName, policyName, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private 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..9ffd597b7f685 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfileImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.azure.resourcemanager.cdn.generated.models.Profile; +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 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 ProfileResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String frontdoorId() { + return this.innerModel().frontdoorId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProfileInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 SsoUri generateSsoUri() { + return serviceManager.profiles().generateSsoUri(resourceGroupName, profileName); + } + + public Response generateSsoUriWithResponse(Context context) { + return serviceManager.profiles().generateSsoUriWithResponse(resourceGroupName, profileName, context); + } + + public SupportedOptimizationTypesListResult listSupportedOptimizationTypes() { + return serviceManager.profiles().listSupportedOptimizationTypes(resourceGroupName, profileName); + } + + public Response listSupportedOptimizationTypesWithResponse(Context context) { + return serviceManager + .profiles() + .listSupportedOptimizationTypesWithResponse(resourceGroupName, profileName, context); + } + + 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; + } + } + + 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..d76e811427d94 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesClientImpl.java @@ -0,0 +1,2209 @@ +// Copyright (c) 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.logging.ClientLogger; +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.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.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 { + private final ClientLogger logger = new ClientLogger(ProfilesClientImpl.class); + + /** 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({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/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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all of the 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a 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 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 CDN profile with the specified profile name under the specified subscription and resource group. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a 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 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 CDN profile with the specified profile name under the specified subscription and resource group. + */ + @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 a 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 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 CDN profile with the specified profile name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String profileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a 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 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 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 getByResourceGroupAsync(resourceGroupName, profileName).block(); + } + + /** + * Gets a 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 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 CDN profile with the specified profile name under the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String profileName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile) { + return beginCreateAsync(resourceGroupName, profileName, profile).getSyncPoller(); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginCreate( + String resourceGroupName, String profileName, ProfileInner profile, Context context) { + return beginCreateAsync(resourceGroupName, profileName, profile, context).getSyncPoller(); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner create(String resourceGroupName, String profileName, ProfileInner profile) { + return createAsync(resourceGroupName, profileName, profile).block(); + } + + /** + * Creates a new 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters).getSyncPoller(); + } + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProfileInner> beginUpdate( + String resourceGroupName, + String profileName, + ProfileUpdateParameters profileUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, profileUpdateParameters, context).getSyncPoller(); + } + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProfileInner update( + String resourceGroupName, String profileName, ProfileUpdateParameters profileUpdateParameters) { + return updateAsync(resourceGroupName, profileName, profileUpdateParameters).block(); + } + + /** + * Updates an existing 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 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 cDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and + * pricing tier. + */ + @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 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 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes an existing 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 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 completion. + */ + @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 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Deletes an existing 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).getSyncPoller(); + } + + /** + * Deletes an existing 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String profileName, Context context) { + return beginDeleteAsync(resourceGroupName, profileName, context).getSyncPoller(); + } + + /** + * Deletes an existing 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String profileName) { + return beginDeleteAsync(resourceGroupName, profileName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing 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 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 completion. + */ + @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 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 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 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 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(); + } + + /** + * 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSsoUriAsync(String resourceGroupName, String profileName) { + return generateSsoUriWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 generateSsoUriAsync(resourceGroupName, profileName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response generateSsoUriWithResponse( + String resourceGroupName, String profileName, Context context) { + return generateSsoUriWithResponseAsync(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 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + */ + @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 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) + private Mono listSupportedOptimizationTypesAsync( + String resourceGroupName, String profileName) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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 listSupportedOptimizationTypesAsync(resourceGroupName, profileName).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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context) { + return listSupportedOptimizationTypesWithResponseAsync(resourceGroupName, profileName, context).block(); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + @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 CDN 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 output of check resource usage API. + */ + @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 CDN 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 output of check resource usage API. + */ + @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 CDN 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 output of check resource usage API. + */ + @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 CDN 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 output of check resource usage API. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..943405f865375 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ProfilesImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) 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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.ProfilesClient; +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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProfilesImpl implements Profiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfilesImpl.class); + + private final ProfilesClient innerClient; + + private final CdnManager serviceManager; + + public ProfilesImpl(ProfilesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new ProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new ProfileImpl(inner1, this.manager())); + } + + 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 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 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 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 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 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 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 PagedIterable listResourceUsage(String resourceGroupName, String profileName) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listResourceUsage( + String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listResourceUsage(resourceGroupName, profileName, context); + return inner.mapPage(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 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..6c206a920056a --- /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.CdnManager; +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 CdnManager serviceManager; + + RankingsResponseImpl(RankingsResponseInner innerObject, 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 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..e311bbbabc657 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersClientImpl.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +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.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 { + private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); + + /** 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("/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 + * 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 checkNameAvailabilityAsync(checkNameAvailabilityInput).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityWithSubscriptionAsync( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 checkNameAvailabilityWithSubscriptionAsync(checkNameAvailabilityInput).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + return checkNameAvailabilityWithSubscriptionWithResponseAsync(checkNameAvailabilityInput, 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateProbeAsync(ValidateProbeInput validateProbeInput) { + return validateProbeWithResponseAsync(validateProbeInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateProbeAsync(validateProbeInput).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response validateProbeWithResponse( + ValidateProbeInput validateProbeInput, Context context) { + return validateProbeWithResponseAsync(validateProbeInput, context).block(); + } +} 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..a2a5c08f7f3cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceProvidersImpl.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.ResourceProvidersClient; +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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceProvidersImpl implements ResourceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final CdnManager serviceManager; + + public ResourceProvidersImpl(ResourceProvidersClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 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 checkNameAvailabilityWithSubscription( + CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = + this.serviceClient().checkNameAvailabilityWithSubscription(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 ValidateProbeOutput validateProbe(ValidateProbeInput validateProbeInput) { + ValidateProbeOutputInner inner = this.serviceClient().validateProbe(validateProbeInput); + if (inner != null) { + return new ValidateProbeOutputImpl(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; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private 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..c0433834a0332 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsageImpl.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.implementation; + +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.azure.resourcemanager.cdn.generated.models.ResourceUsage; + +public final class ResourceUsageImpl implements ResourceUsage { + private ResourceUsageInner innerObject; + + private final CdnManager serviceManager; + + ResourceUsageImpl(ResourceUsageInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String 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 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..d3df60ee54204 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(ResourceUsagesClientImpl.class); + + /** 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..7b139b60a5f41 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ResourceUsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceUsagesImpl implements ResourceUsages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUsagesImpl.class); + + private final ResourceUsagesClient innerClient; + + private final CdnManager serviceManager; + + public ResourceUsagesImpl(ResourceUsagesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ResourceUsageImpl(inner1, this.manager())); + } + + private ResourceUsagesClient serviceClient() { + return this.innerClient; + } + + private 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..ba536eb4c1db6 --- /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.CdnManager; +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 CdnManager serviceManager; + + ResourcesResponseImpl(ResourcesResponseInner innerObject, 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 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..dca6f3d8c1984 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RouteImpl.java @@ -0,0 +1,347 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.cdn.generated.models.AfdEndpointProtocols; +import com.azure.resourcemanager.cdn.generated.models.AfdProvisioningState; +import com.azure.resourcemanager.cdn.generated.models.AfdQueryStringCachingBehavior; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class RouteImpl implements Route, Route.Definition, Route.Update { + private RouteInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 Object compressionSettings() { + return this.innerModel().compressionSettings(); + } + + public AfdQueryStringCachingBehavior queryStringCachingBehavior() { + return this.innerModel().queryStringCachingBehavior(); + } + + 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 AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RouteInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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 withCompressionSettings(Object compressionSettings) { + if (isInCreateMode()) { + this.innerModel().withCompressionSettings(compressionSettings); + return this; + } else { + this.updateRouteUpdateProperties.withCompressionSettings(compressionSettings); + return this; + } + } + + public RouteImpl withQueryStringCachingBehavior(AfdQueryStringCachingBehavior queryStringCachingBehavior) { + if (isInCreateMode()) { + this.innerModel().withQueryStringCachingBehavior(queryStringCachingBehavior); + return this; + } else { + this.updateRouteUpdateProperties.withQueryStringCachingBehavior(queryStringCachingBehavior); + 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..42dcad56cc079 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1596 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(RoutesClientImpl.class); + + /** 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 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 routes. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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 routes. + */ + @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 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 routes. + */ + @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 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 routes. + */ + @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 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 routes. + */ + @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 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 routes. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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) + private Mono getAsync( + String resourceGroupName, String profileName, String endpointName, String routeName) { + return getWithResponseAsync(resourceGroupName, profileName, endpointName, routeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN 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 getAsync(resourceGroupName, profileName, endpointName, routeName).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 CDN 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. + */ + @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(); + } + + /** + * 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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, Context.NONE); + } + + /** + * 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 CDN 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, Context.NONE); + } + + /** + * 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 CDN 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..a45caf1c77405 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RoutesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RoutesImpl implements Routes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutesImpl.class); + + private final RoutesClient innerClient; + + private final CdnManager serviceManager; + + public RoutesImpl(RoutesClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new RouteImpl(inner1, this.manager())); + } + + 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 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 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 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..a591f4da7ac2d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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 com.azure.resourcemanager.cdn.generated.models.SystemData; +import java.util.Collections; +import java.util.List; + +public final class RuleImpl implements Rule, Rule.Definition, Rule.Update { + private RuleInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RuleInner innerModel() { + return this.innerObject; + } + + private 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, 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, 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..1a34960c667d6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetImpl.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.implementation; + +import com.azure.resourcemanager.cdn.generated.CdnManager; +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; +import com.azure.resourcemanager.cdn.generated.models.SystemData; + +public final class RuleSetImpl implements RuleSet { + private RuleSetInner innerObject; + + private final CdnManager serviceManager; + + RuleSetImpl(RuleSetInner innerObject, 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 AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RuleSetInner innerModel() { + return this.innerObject; + } + + private 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..eb0074dfa1840 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsClientImpl.java @@ -0,0 +1,1373 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(RuleSetsClientImpl.class); + + /** 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, 202}) + @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, 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 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 rule sets. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists existing AzureFrontDoor rule sets within a 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 result of the request to list rule sets. + */ + @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 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 rule sets. + */ + @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 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 rule sets. + */ + @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 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 rule sets. + */ + @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 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 rule sets. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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) + private Mono getAsync(String resourceGroupName, String profileName, String ruleSetName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN 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 getAsync(resourceGroupName, profileName, ruleSetName).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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return getWithResponseAsync(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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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) + private PollerFlux, RuleSetInner> beginCreateAsync( + String resourceGroupName, String profileName, String ruleSetName) { + Mono>> mono = createWithResponseAsync(resourceGroupName, profileName, ruleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleSetInner.class, RuleSetInner.class, Context.NONE); + } + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RuleSetInner> beginCreateAsync( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, profileName, ruleSetName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RuleSetInner.class, RuleSetInner.class, 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 CDN 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 SyncPoller, RuleSetInner> beginCreate( + String resourceGroupName, String profileName, String ruleSetName) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName).getSyncPoller(); + } + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RuleSetInner> beginCreate( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, context).getSyncPoller(); + } + + /** + * 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 CDN 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) + private Mono createAsync(String resourceGroupName, String profileName, String ruleSetName) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String profileName, String ruleSetName, Context context) { + return beginCreateAsync(resourceGroupName, profileName, ruleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 CDN 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 createAsync(resourceGroupName, profileName, ruleSetName).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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuleSetInner create(String resourceGroupName, String profileName, String ruleSetName, Context context) { + return createAsync(resourceGroupName, profileName, ruleSetName, context).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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 CDN 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 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..b387d0455182a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RuleSetsImpl.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RuleSetsImpl implements RuleSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleSetsImpl.class); + + private final RuleSetsClient innerClient; + + private final CdnManager serviceManager; + + public RuleSetsImpl(RuleSetsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new RuleSetImpl(inner1, this.manager())); + } + + 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 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 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 RuleSet create(String resourceGroupName, String profileName, String ruleSetName, Context context) { + RuleSetInner inner = this.serviceClient().create(resourceGroupName, profileName, ruleSetName, context); + 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 inner.mapPage(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 inner.mapPage(inner1 -> new UsageImpl(inner1, this.manager())); + } + + private RuleSetsClient serviceClient() { + return this.innerClient; + } + + private 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..16aad15bcafca --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesClientImpl.java @@ -0,0 +1,1553 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(RulesClientImpl.class); + + /** 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 CDN 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 CDN 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. + */ + @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 CDN 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) + private Mono getAsync( + String resourceGroupName, String profileName, String ruleSetName, String ruleName) { + return getWithResponseAsync(resourceGroupName, profileName, ruleSetName, ruleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 CDN 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 getAsync(resourceGroupName, profileName, ruleSetName, ruleName).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 CDN 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. + */ + @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(); + } + + /** + * 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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, Context.NONE); + } + + /** + * 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 CDN 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, Context.NONE); + } + + /** + * 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 CDN 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 CDN 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..870cfb6f70bcd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/RulesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RulesImpl implements Rules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RulesImpl.class); + + private final RulesClient innerClient; + + private final CdnManager serviceManager; + + public RulesImpl(RulesClient innerClient, 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 inner.mapPage(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 inner.mapPage(inner1 -> new RuleImpl(inner1, this.manager())); + } + + 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 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 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 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..2738cfd4fdea1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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; +import com.azure.resourcemanager.cdn.generated.models.SecretProperties; +import com.azure.resourcemanager.cdn.generated.models.SystemData; + +public final class SecretImpl implements Secret, Secret.Definition, Secret.Update { + private SecretInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SecretParameters parameters() { + return this.innerModel().parameters(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SecretInner innerModel() { + return this.innerObject; + } + + private CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String secretName; + + private SecretProperties updateSecretProperties; + + 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, CdnManager serviceManager) { + this.innerObject = new SecretInner(); + this.serviceManager = serviceManager; + this.secretName = name; + } + + public SecretImpl update() { + this.updateSecretProperties = new SecretProperties(); + return this; + } + + public Secret apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .update(resourceGroupName, profileName, secretName, updateSecretProperties, Context.NONE); + return this; + } + + public Secret apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .update(resourceGroupName, profileName, secretName, updateSecretProperties, context); + return this; + } + + SecretImpl(SecretInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.profileName = Utils.getValueFromIdByName(innerObject.id(), "profiles"); + this.secretName = Utils.getValueFromIdByName(innerObject.id(), "secrets"); + } + + 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) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateSecretProperties.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/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..6d82bf36f7a9e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsClientImpl.java @@ -0,0 +1,1406 @@ +// Copyright (c) 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.logging.ClientLogger; +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 com.azure.resourcemanager.cdn.generated.models.SecretProperties; +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 { + private final ClientLogger logger = new ClientLogger(SecretsClientImpl.class); + + /** 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"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" + + "/{profileName}/secrets/{secretName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @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") SecretProperties secretProperties, + @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 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 secrets. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists existing AzureFrontDoor secrets. + * + * @param resourceGroupName 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 secrets. + */ + @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 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 secrets. + */ + @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 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 secrets. + */ + @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 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 secrets. + */ + @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 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 secrets. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an existing Secret within a 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 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. + */ + @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 CDN 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) + private Mono getAsync(String resourceGroupName, String profileName, String secretName) { + return getWithResponseAsync(resourceGroupName, profileName, secretName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an existing Secret within a 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 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 getAsync(resourceGroupName, profileName, secretName).block(); + } + + /** + * Gets an existing Secret within a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String secretName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, secretName, context).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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, Context.NONE); + } + + /** + * Creates a new Secret within the specified 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 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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(); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties) { + 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 (secretProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretProperties is required and cannot be null.")); + } else { + secretProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + secretProperties, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + 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 (secretProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter secretProperties is required and cannot be null.")); + } else { + secretProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + profileName, + secretName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + secretProperties, + accept, + context); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private PollerFlux, SecretInner> beginUpdateAsync( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, secretName, secretProperties); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, Context.NONE); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private PollerFlux, SecretInner> beginUpdateAsync( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, profileName, secretName, secretProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, context); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 SyncPoller, SecretInner> beginUpdate( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties) { + return beginUpdateAsync(resourceGroupName, profileName, secretName, secretProperties).getSyncPoller(); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 SyncPoller, SecretInner> beginUpdate( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, secretName, secretProperties, context).getSyncPoller(); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private Mono updateAsync( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties) { + return beginUpdateAsync(resourceGroupName, profileName, secretName, secretProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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) + private Mono updateAsync( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context) { + return beginUpdateAsync(resourceGroupName, profileName, secretName, secretProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 update( + String resourceGroupName, String profileName, String secretName, SecretProperties secretProperties) { + return updateAsync(resourceGroupName, profileName, secretName, secretProperties).block(); + } + + /** + * Updates an existing Secret within a 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 secretName Name of the Secret under the profile. + * @param secretProperties 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 update( + String resourceGroupName, + String profileName, + String secretName, + SecretProperties secretProperties, + Context context) { + return updateAsync(resourceGroupName, profileName, secretName, secretProperties, context).block(); + } + + /** + * Deletes an existing Secret within 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 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Deletes an existing Secret within 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN 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 completion. + */ + @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 CDN 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 completion. + */ + @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 CDN 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 CDN 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 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..9a553f8b4566c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecretsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecretsImpl implements Secrets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretsImpl.class); + + private final SecretsClient innerClient; + + private final CdnManager serviceManager; + + public SecretsImpl(SecretsClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new SecretImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new SecretImpl(inner1, this.manager())); + } + + 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 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 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 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..1a24879b455c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesClientImpl.java @@ -0,0 +1,1472 @@ +// Copyright (c) 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.logging.ClientLogger; +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.SecurityPolicyProperties; +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 { + private final ClientLogger logger = new ClientLogger(SecurityPoliciesClientImpl.class); + + /** 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") SecurityPolicyProperties securityPolicyProperties, + @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 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 security policies. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists security policies associated with the 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 result of the request to list security policies. + */ + @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 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 security policies. + */ + @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 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 security policies. + */ + @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 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 security policies. + */ + @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 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 security policies. + */ + @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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an existing security policy within a 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 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. + */ + @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 CDN 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) + private Mono getAsync( + String resourceGroupName, String profileName, String securityPolicyName) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an existing security policy within a 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 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 getAsync(resourceGroupName, profileName, securityPolicyName).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 CDN 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String profileName, String securityPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, profileName, securityPolicyName, context).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 CDN 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) + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN 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) + 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 CDN 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) + 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, + Context.NONE); + } + + /** + * 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 CDN 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) + 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 CDN 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 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 CDN 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 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 CDN 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) + 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 CDN 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) + 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 CDN 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 CDN 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 Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private Mono>> patchWithResponseAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties) { + 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 (securityPolicyProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityPolicyProperties is required and cannot be null.")); + } else { + securityPolicyProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + profileName, + securityPolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + securityPolicyProperties, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private Mono>> patchWithResponseAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties, + 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 (securityPolicyProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityPolicyProperties is required and cannot be null.")); + } else { + securityPolicyProperties.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(), + securityPolicyProperties, + accept, + context); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private PollerFlux, SecurityPolicyInner> beginPatchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties) { + Mono>> mono = + patchWithResponseAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SecurityPolicyInner.class, + SecurityPolicyInner.class, + Context.NONE); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private PollerFlux, SecurityPolicyInner> beginPatchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + patchWithResponseAsync( + resourceGroupName, profileName, securityPolicyName, securityPolicyProperties, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SecurityPolicyInner.class, SecurityPolicyInner.class, context); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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 SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties) + .getSyncPoller(); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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 SyncPoller, SecurityPolicyInner> beginPatch( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties, + Context context) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties, context) + .getSyncPoller(); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private Mono patchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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) + private Mono patchAsync( + String resourceGroupName, + String profileName, + String securityPolicyName, + SecurityPolicyProperties securityPolicyProperties, + Context context) { + return beginPatchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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, + SecurityPolicyProperties securityPolicyProperties) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties).block(); + } + + /** + * Updates an existing Secret within a 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 securityPolicyName Name of the security policy under the profile. + * @param securityPolicyProperties 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, + SecurityPolicyProperties securityPolicyProperties, + Context context) { + return patchAsync(resourceGroupName, profileName, securityPolicyName, securityPolicyProperties, 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * Deletes an existing security policy within 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 securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 completion. + */ + @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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 securityPolicyName, Context context) { + deleteAsync(resourceGroupName, profileName, securityPolicyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink 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. + */ + @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..56571982fb091 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPoliciesImpl.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.CdnManager; +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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityPoliciesImpl implements SecurityPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPoliciesImpl.class); + + private final SecurityPoliciesClient innerClient; + + private final CdnManager serviceManager; + + public SecurityPoliciesImpl(SecurityPoliciesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName) { + PagedIterable inner = this.serviceClient().listByProfile(resourceGroupName, profileName); + return inner.mapPage(inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) { + PagedIterable inner = + this.serviceClient().listByProfile(resourceGroupName, profileName, context); + return inner.mapPage(inner1 -> new SecurityPolicyImpl(inner1, this.manager())); + } + + 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 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 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 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..02d3931dbfe91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SecurityPolicyImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cdn.generated.CdnManager; +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.SecurityPolicyParameters; +import com.azure.resourcemanager.cdn.generated.models.SecurityPolicyProperties; +import com.azure.resourcemanager.cdn.generated.models.SystemData; + +public final class SecurityPolicyImpl implements SecurityPolicy, SecurityPolicy.Definition, SecurityPolicy.Update { + private SecurityPolicyInner innerObject; + + private final CdnManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AfdProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeploymentStatus deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public SecurityPolicyParameters parameters() { + return this.innerModel().parameters(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SecurityPolicyInner innerModel() { + return this.innerObject; + } + + private CdnManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String profileName; + + private String securityPolicyName; + + private SecurityPolicyProperties updateSecurityPolicyProperties; + + 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, CdnManager serviceManager) { + this.innerObject = new SecurityPolicyInner(); + this.serviceManager = serviceManager; + this.securityPolicyName = name; + } + + public SecurityPolicyImpl update() { + this.updateSecurityPolicyProperties = new SecurityPolicyProperties(); + return this; + } + + public SecurityPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .patch( + resourceGroupName, profileName, securityPolicyName, updateSecurityPolicyProperties, Context.NONE); + return this; + } + + public SecurityPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityPolicies() + .patch(resourceGroupName, profileName, securityPolicyName, updateSecurityPolicyProperties, context); + return this; + } + + SecurityPolicyImpl(SecurityPolicyInner innerObject, 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(SecurityPolicyParameters parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateSecurityPolicyProperties.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..748ed1eca83e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/SsoUriImpl.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.implementation; + +import com.azure.resourcemanager.cdn.generated.CdnManager; +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 CdnManager serviceManager; + + SsoUriImpl(SsoUriInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String ssoUriValue() { + return this.innerModel().ssoUriValue(); + } + + public SsoUriInner innerModel() { + return this.innerObject; + } + + private 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..e14de428be056 --- /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.CdnManager; +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 CdnManager serviceManager; + + SupportedOptimizationTypesListResultImpl( + SupportedOptimizationTypesListResultInner innerObject, 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 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..b122d33427e4b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/UsageImpl.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.CdnManager; +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 CdnManager serviceManager; + + UsageImpl(UsageInner innerObject, 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 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..60be77b11357a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/Utils.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.implementation; + +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; + +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; + } +} 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..0c46130b7d60b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidateCustomDomainOutputImpl.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.CdnManager; +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 CdnManager serviceManager; + + ValidateCustomDomainOutputImpl(ValidateCustomDomainOutputInner innerObject, 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 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..9b6590144f1a5 --- /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.CdnManager; +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 CdnManager serviceManager; + + ValidateProbeOutputImpl(ValidateProbeOutputInner innerObject, 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 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..20704c502e61b --- /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.CdnManager; +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 CdnManager serviceManager; + + ValidateSecretOutputImpl(ValidateSecretOutputInner innerObject, 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 CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesClientImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesClientImpl.java new file mode 100644 index 0000000000000..44fb605a28bb3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesClientImpl.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.ValidatesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ValidatesClient. */ +public final class ValidatesClientImpl implements ValidatesClient { + private final ClientLogger logger = new ClientLogger(ValidatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ValidatesService service; + + /** The service client containing this operation class. */ + private final CdnManagementClientImpl client; + + /** + * Initializes an instance of ValidatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidatesClientImpl(CdnManagementClientImpl client) { + this.service = + RestProxy.create(ValidatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CdnManagementClientValidates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CdnManagementClientV") + private interface ValidatesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateSecret") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> secret( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ValidateSecretInput validateSecretInput, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Validate a Secret in the profile. + * + * @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) + private Mono> secretWithResponseAsync(ValidateSecretInput validateSecretInput) { + 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 (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 + .secret( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateSecretInput, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Validate a Secret in the profile. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> secretWithResponseAsync( + 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 (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 + .secret( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + validateSecretInput, + accept, + context); + } + + /** + * Validate a Secret in the profile. + * + * @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) + private Mono secretAsync(ValidateSecretInput validateSecretInput) { + return secretWithResponseAsync(validateSecretInput) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Validate a Secret in the profile. + * + * @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 secret(ValidateSecretInput validateSecretInput) { + return secretAsync(validateSecretInput).block(); + } + + /** + * Validate a Secret in the profile. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response secretWithResponse( + ValidateSecretInput validateSecretInput, Context context) { + return secretWithResponseAsync(validateSecretInput, context).block(); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesImpl.java new file mode 100644 index 0000000000000..e1e0d87bb4ab3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidatesImpl.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.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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.ValidatesClient; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidateSecretOutputInner; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretInput; +import com.azure.resourcemanager.cdn.generated.models.ValidateSecretOutput; +import com.azure.resourcemanager.cdn.generated.models.Validates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ValidatesImpl implements Validates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidatesImpl.class); + + private final ValidatesClient innerClient; + + private final CdnManager serviceManager; + + public ValidatesImpl(ValidatesClient innerClient, CdnManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ValidateSecretOutput secret(ValidateSecretInput validateSecretInput) { + ValidateSecretOutputInner inner = this.serviceClient().secret(validateSecretInput); + if (inner != null) { + return new ValidateSecretOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response secretWithResponse(ValidateSecretInput validateSecretInput, Context context) { + Response inner = + this.serviceClient().secretWithResponse(validateSecretInput, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateSecretOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ValidatesClient serviceClient() { + return this.innerClient; + } + + private CdnManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidationTokenImpl.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidationTokenImpl.java new file mode 100644 index 0000000000000..7730fd5f96d78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/implementation/ValidationTokenImpl.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.implementation; + +import com.azure.resourcemanager.cdn.generated.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.ValidationTokenInner; +import com.azure.resourcemanager.cdn.generated.models.ValidationToken; + +public final class ValidationTokenImpl implements ValidationToken { + private ValidationTokenInner innerObject; + + private final CdnManager serviceManager; + + ValidationTokenImpl(ValidationTokenInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String token() { + return this.innerModel().token(); + } + + public ValidationTokenInner innerModel() { + return this.innerObject; + } + + private 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..3de3dd03ec97b --- /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.CdnManager; +import com.azure.resourcemanager.cdn.generated.fluent.models.WafMetricsResponseInner; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponse; +import com.azure.resourcemanager.cdn.generated.models.WafMetricsResponseGranularity; +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 CdnManager serviceManager; + + WafMetricsResponseImpl(WafMetricsResponseInner innerObject, CdnManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime dateTimeBegin() { + return this.innerModel().dateTimeBegin(); + } + + public OffsetDateTime dateTimeEnd() { + return this.innerModel().dateTimeEnd(); + } + + public WafMetricsResponseGranularity 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 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..009caa97cb0ce --- /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.CdnManager; +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 CdnManager serviceManager; + + WafRankingsResponseImpl(WafRankingsResponseInner innerObject, 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 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..c72c1d583af48 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ActionType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +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); + } + + /** @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/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..79ce0159cb7bd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCertificateType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AfdCertificateType. */ +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"); + + /** + * 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); + } + + /** @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..540c25a1f32c8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdCustomDomains.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.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 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 domains. + */ + 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 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 domains. + */ + 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 CDN 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); + + /** + * 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 CDN 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. + */ + Response getWithResponse( + 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 CDN 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 CDN 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 CDN 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 validation token. + */ + ValidationToken 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 CDN 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 validation token. + */ + ValidationToken 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. + */ + 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. + */ + 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..858b34cf09871 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomain.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Context; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; + +/** 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 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 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 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 validationProperties property: Values the customer needs to validate domain ownership. + * + * @return the validationProperties value. + */ + DomainValidationProperties validationProperties(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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.WithTlsSettings, DefinitionStages.WithAzureDnsZone, DefinitionStages.WithHostname { + /** + * 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 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 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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. + * @return the validation token. + */ + ValidationToken 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. + * @return the validation token. + */ + ValidationToken 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..a3da938f9ffee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainHttpsParameters.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to secure a domain. */ +@Fluent +public final class AfdDomainHttpsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainHttpsParameters.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..2a1e7f305df67 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdDomainInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainListResult.class); + + /* + * 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; + + /** + * 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/AfdDomainProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainProperties.java new file mode 100644 index 0000000000000..4b19fbf1e7174 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainProperties.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public final class AfdDomainProperties extends AfdDomainUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainProperties.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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(); + } + } +} 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..f75d954aaee30 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdateParameters.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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The domain JSON object required for domain creation or update. */ +@JsonFlatten +@Fluent +public class AfdDomainUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainUpdateParameters.class); + + /* + * 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 = "properties.tlsSettings") + private AfdDomainHttpsParameters tlsSettings; + + /* + * Resource reference to the Azure DNS zone + */ + @JsonProperty(value = "properties.azureDnsZone") + private ResourceReference azureDnsZone; + + /** + * 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 AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters 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 AfdDomainUpdateParameters object itself. + */ + public AfdDomainUpdateParameters withAzureDnsZone(ResourceReference azureDnsZone) { + this.azureDnsZone = azureDnsZone; + 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(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..1936e8866b8fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdDomainUpdatePropertiesParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public class AfdDomainUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdDomainUpdatePropertiesParameters.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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(); + } + } +} 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..20962016a4030 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoint.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.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.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 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 enabledState property: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. + * + * @return the enabledState value. + */ + EnabledState enabledState(); + + /** + * 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.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 CDN 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.WithOriginResponseTimeoutSeconds, + 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 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); + } + /** 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.WithOriginResponseTimeoutSeconds, 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 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); + } + /** 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 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 the list usages operation response. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given 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 the list usages operation response. + */ + PagedIterable listResourceUsage(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); + + /** + * 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. + */ + Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context); +} 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..d69b5adc60a35 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointListResult.class); + + /* + * 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; + + /** + * 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/AfdEndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProperties.java new file mode 100644 index 0000000000000..3afb1b11cd46b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties required to create an endpoint. */ +@Immutable +public final class AfdEndpointProperties extends AfdEndpointPropertiesUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointProperties.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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 withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + super.withOriginResponseTimeoutSeconds(originResponseTimeoutSeconds); + return this; + } + + /** {@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/models/AfdEndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..7f240ffbebed5 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointPropertiesUpdateParameters.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object containing endpoint update parameters. */ +@Fluent +public class AfdEndpointPropertiesUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointPropertiesUpdateParameters.class); + + /* + * 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; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "enabledState") + private EnabledState enabledState; + + /** + * 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 AfdEndpointPropertiesUpdateParameters object itself. + */ + public AfdEndpointPropertiesUpdateParameters withOriginResponseTimeoutSeconds( + Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + 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 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/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..b19340fef8966 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointProtocols.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AfdEndpointProtocols. */ +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); + } + + /** @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..fb9f2fbd2a8c6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpointUpdateParameters.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.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to create or update an endpoint. */ +@JsonFlatten +@Fluent +public class AfdEndpointUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdEndpointUpdateParameters.class); + + /* + * Endpoint tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Send and receive timeout on forwarding request to the origin. When + * timeout is reached, the request fails and returns. + */ + @JsonProperty(value = "properties.originResponseTimeoutSeconds") + private Integer originResponseTimeoutSeconds; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private EnabledState enabledState; + + /** + * 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 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 AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters withOriginResponseTimeoutSeconds(Integer originResponseTimeoutSeconds) { + this.originResponseTimeoutSeconds = originResponseTimeoutSeconds; + 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 AfdEndpointUpdateParameters object itself. + */ + public AfdEndpointUpdateParameters 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/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..3898d60615480 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdEndpoints.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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. + */ + 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 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. + */ + 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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + AfdEndpoint get(String resourceGroupName, String profileName, String endpointName); + + /** + * 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 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 AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, + * resource group and profile. + */ + Response getWithResponse( + 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 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 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 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); + + /** + * Removes a content from AzureFrontDoor. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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 CDN 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 CDN 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 list usages operation response. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String endpointName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + PagedIterable listResourceUsage( + String resourceGroupName, String profileName, String endpointName, 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); + + /** + * 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. + */ + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context context); + + /** + * 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. + */ + 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. + */ + 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..75107b7531b37 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdMinimumTlsVersion.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AfdMinimumTlsVersion. */ +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) { + AfdMinimumTlsVersion[] items = AfdMinimumTlsVersion.values(); + for (AfdMinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..9bd613e8093f0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigin.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 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 sharedPrivateLinkResource property: The properties of the private link resource for private origin. + * + * @return the sharedPrivateLinkResource value. + */ + Object 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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 { + /** + * 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 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 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(Object 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); + } + } + /** + * 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 { + /** + * 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 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 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(Object 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); + } + } + /** + * 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..0fee9c03b78a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroup.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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; +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 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 responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedAfdOriginErrorDetectionSettings value. + */ + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings(); + + /** + * 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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.WithResponseBasedAfdOriginErrorDetectionSettings, + 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 responseBasedAfdOriginErrorDetectionSettings. + */ + interface WithResponseBasedAfdOriginErrorDetectionSettings { + /** + * Specifies the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedAfdOriginErrorDetectionSettings 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 withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings); + } + /** 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.WithResponseBasedAfdOriginErrorDetectionSettings, + 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 responseBasedAfdOriginErrorDetectionSettings. */ + interface WithResponseBasedAfdOriginErrorDetectionSettings { + /** + * Specifies the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the + * properties to determine origin health using real requests/responses. This property is currently not + * supported.. + * + * @param responseBasedAfdOriginErrorDetectionSettings 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 withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings); + } + /** 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 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 the list usages operation response. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given 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 the list usages operation response. + */ + 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..a138a299a732f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupListResult.class); + + /* + * 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; + + /** + * 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 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/AfdOriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupProperties.java new file mode 100644 index 0000000000000..a931c452b8427 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupProperties.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin group. */ +@Immutable +public final class AfdOriginGroupProperties extends AfdOriginGroupUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupProperties.class); + + /* + * 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; + + /** + * 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 withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings) { + super.withResponseBasedAfdOriginErrorDetectionSettings(responseBasedAfdOriginErrorDetectionSettings); + 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/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..301644d9d5a6b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdateParameters.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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AFDOrigin group properties needed for origin group creation or update. */ +@JsonFlatten +@Fluent +public class AfdOriginGroupUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupUpdateParameters.class); + + /* + * Load balancing settings for a backend pool + */ + @JsonProperty(value = "properties.loadBalancingSettings") + private LoadBalancingSettingsParameters loadBalancingSettings; + + /* + * Health probe settings to the origin that is used to determine the health + * of the origin. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.responseBasedAfdOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings; + + /* + * Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.sessionAffinityState") + private EnabledState sessionAffinityState; + + /** + * 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 AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters 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 AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters 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 AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withTrafficRestorationTimeToHealedOrNewEndpointsInMinutes( + Integer trafficRestorationTimeToHealedOrNewEndpointsInMinutes) { + this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = + trafficRestorationTimeToHealedOrNewEndpointsInMinutes; + return this; + } + + /** + * Get the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedAfdOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings() { + return this.responseBasedAfdOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedAfdOriginErrorDetectionSettings the responseBasedAfdOriginErrorDetectionSettings value to + * set. + * @return the AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings) { + this.responseBasedAfdOriginErrorDetectionSettings = responseBasedAfdOriginErrorDetectionSettings; + 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 AfdOriginGroupUpdateParameters object itself. + */ + public AfdOriginGroupUpdateParameters 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(); + } + if (responseBasedAfdOriginErrorDetectionSettings() != null) { + responseBasedAfdOriginErrorDetectionSettings().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..c9413c982125d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroupUpdatePropertiesParameters.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public class AfdOriginGroupUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginGroupUpdatePropertiesParameters.class); + + /* + * 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; + + /* + * The JSON object that contains the properties to determine origin health + * using real requests/responses. This property is currently not supported. + */ + @JsonProperty(value = "responseBasedAfdOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings; + + /* + * Whether to allow session affinity on this host. Valid options are + * 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "sessionAffinityState") + private EnabledState sessionAffinityState; + + /** + * 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 responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @return the responseBasedAfdOriginErrorDetectionSettings value. + */ + public ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings() { + return this.responseBasedAfdOriginErrorDetectionSettings; + } + + /** + * Set the responseBasedAfdOriginErrorDetectionSettings property: The JSON object that contains the properties to + * determine origin health using real requests/responses. This property is currently not supported. + * + * @param responseBasedAfdOriginErrorDetectionSettings the responseBasedAfdOriginErrorDetectionSettings value to + * set. + * @return the AfdOriginGroupUpdatePropertiesParameters object itself. + */ + public AfdOriginGroupUpdatePropertiesParameters withResponseBasedAfdOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings) { + this.responseBasedAfdOriginErrorDetectionSettings = responseBasedAfdOriginErrorDetectionSettings; + 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(); + } + if (responseBasedAfdOriginErrorDetectionSettings() != null) { + responseBasedAfdOriginErrorDetectionSettings().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..0db9d0fc8aaa7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginGroups.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.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 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 origin groups. + */ + 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 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 origin groups. + */ + 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 CDN 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); + + /** + * Gets an existing origin group within a 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 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. + */ + Response getWithResponse( + 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 CDN 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 CDN 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 CDN 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 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. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String originGroupName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + 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. + */ + 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. + */ + 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..7f77cb96e215f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.AfdOriginInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginListResult.class); + + /* + * 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; + + /** + * 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 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/AfdOriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginProperties.java new file mode 100644 index 0000000000000..2a5d7c60d6e84 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Immutable +public final class AfdOriginProperties extends AfdOriginUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginProperties.class); + + /* + * 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; + + /** + * 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(Object sharedPrivateLinkResource) { + super.withSharedPrivateLinkResource(sharedPrivateLinkResource); + return this; + } + + /** {@inheritDoc} */ + @Override + public AfdOriginProperties 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/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..b5fe3f4ceb33a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdateParameters.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AFDOrigin properties needed for origin update. */ +@JsonFlatten +@Fluent +public class AfdOriginUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginUpdateParameters.class); + + /* + * Resource reference to the Azure origin resource. + */ + @JsonProperty(value = "properties.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 = "properties.hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000 + */ + @JsonProperty(value = "properties.weight") + private Integer weight; + + /* + * The properties of the private link resource for private origin. + */ + @JsonProperty(value = "properties.sharedPrivateLinkResource") + private Object 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 = "properties.enabledState") + private EnabledState enabledState; + + /** + * 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters 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 Object 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withSharedPrivateLinkResource(Object 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 AfdOriginUpdateParameters object itself. + */ + public AfdOriginUpdateParameters withEnabledState(EnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureOrigin() != null) { + azureOrigin().validate(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..6288b7b18ecea --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOriginUpdatePropertiesParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public class AfdOriginUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdOriginUpdatePropertiesParameters.class); + + /* + * 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 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; + + /* + * The properties of the private link resource for private origin. + */ + @JsonProperty(value = "sharedPrivateLinkResource") + private Object 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; + + /** + * 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 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 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 Object 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(Object 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureOrigin() != null) { + azureOrigin().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..3983fa545958c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdOrigins.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 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 CDN 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. + */ + 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 CDN 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. + */ + 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 CDN 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); + + /** + * Gets an existing origin within an origin group. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param profileName Name of the CDN 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. + */ + Response getWithResponse( + 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 CDN 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 CDN 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. + */ + 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. + */ + 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..53f37a586f8ab --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProfiles.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.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 CDN 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 list usages operation response. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 list usages operation response. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, 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 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 custom domain validation. + */ + ValidateCustomDomainOutput checkHostnameAvailability( + String resourceGroupName, String profileName, ValidateCustomDomainInput checkHostnameAvailabilityInput); + + /** + * 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 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 custom domain validation. + */ + Response checkHostnameAvailabilityWithResponse( + String resourceGroupName, + String profileName, + ValidateCustomDomainInput checkHostnameAvailabilityInput, + 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..d5afc407eba9e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AfdProvisioningState. */ +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); + } + + /** @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..759769caa4376 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdPurgeParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content purge. */ +@Fluent +public final class AfdPurgeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdPurgeParameters.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..a518588552e8f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/AfdQueryStringCachingBehavior.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AfdQueryStringCachingBehavior. */ +public enum AfdQueryStringCachingBehavior { + /** Enum value IgnoreQueryString. */ + IGNORE_QUERY_STRING("IgnoreQueryString"), + + /** Enum value UseQueryString. */ + USE_QUERY_STRING("UseQueryString"), + + /** Enum value NotSet. */ + NOT_SET("NotSet"); + + /** The actual serialized value for a AfdQueryStringCachingBehavior instance. */ + private final String value; + + AfdQueryStringCachingBehavior(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AfdQueryStringCachingBehavior instance. + * + * @param value the serialized value to parse. + * @return the parsed AfdQueryStringCachingBehavior object, or null if unable to parse. + */ + @JsonCreator + public static AfdQueryStringCachingBehavior fromString(String value) { + AfdQueryStringCachingBehavior[] items = AfdQueryStringCachingBehavior.values(); + for (AfdQueryStringCachingBehavior item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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/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..4a3665b941392 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The tracking states for afd resources. */ +@Immutable +public class AfdStateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AfdStateProperties.class); + + /* + * 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; + + /** + * 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..eb230b6a3d8a7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Algorithm.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Algorithm. */ +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); + } + + /** @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/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..c539bc04db96f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheBehavior.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CacheBehavior. */ +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); + } + + /** @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/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..01cf583fe06ba --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheExpirationActionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the cache expiration action. */ +@Fluent +public final class CacheExpirationActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheExpirationActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the CacheExpirationActionParameters object itself. + */ + public CacheExpirationActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..5f0279640cd96 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheKeyQueryStringActionParameters.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the cache-key query string action. */ +@Fluent +public final class CacheKeyQueryStringActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheKeyQueryStringActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the CacheKeyQueryStringActionParameters object itself. + */ + public CacheKeyQueryStringActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..bc8b5b1b2d1a4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CacheType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CacheType. */ +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); + } + + /** @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/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..3ac525746e849 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnCertificateSourceParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for using CDN managed certificate for securing custom domain. */ +@Fluent +public final class CdnCertificateSourceParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnCertificateSourceParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * Type of certificate used + */ + @JsonProperty(value = "certificateType", required = true) + private CertificateType certificateType; + + /** Creates an instance of CdnCertificateSourceParameters class. */ + public CdnCertificateSourceParameters() { + odataType = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the CdnCertificateSourceParameters object itself. + */ + public CdnCertificateSourceParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..49ceb6dac34b2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the ARM Resource ID for the linked endpoints. */ +@Fluent +public final class CdnEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnEndpoint.class); + + /* + * ARM Resource ID string. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..338f26e467dd4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnManagedHttpsParameters.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnManagedHttpsParameters.class); + + /* + * Defines the certificate source parameters using CDN managed certificate + * for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private CdnCertificateSourceParameters certificateSourceParameters; + + /** + * 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(); + } + } +} 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..f5e2e1d5d89eb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicy.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.models; + +import com.azure.core.management.Region; +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 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.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 { + /** + * 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); + } + } + /** + * 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..364f8c4c92be8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyList.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.CdnWebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnWebApplicationFirewallPolicyList.class); + + /* + * 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; + + /** + * 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..d157b52bcdb67 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CdnWebApplicationFirewallPolicyPatchParameters.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to update a CdnWebApplicationFirewallPolicy. */ +@Fluent +public final class CdnWebApplicationFirewallPolicyPatchParameters { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(CdnWebApplicationFirewallPolicyPatchParameters.class); + + /* + * CdnWebApplicationFirewallPolicy tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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..941950eeb5f5d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Certificate.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate used for https. */ +@Fluent +public class Certificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Certificate.class); + + /* + * Subject name in the certificate. + */ + @JsonProperty(value = "subject") + private String subject; + + /* + * Certificate expiration date. + */ + @JsonProperty(value = "expirationDate") + private String expirationDate; + + /* + * Certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get the subject property: Subject name in the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject name in the certificate. + * + * @param subject the subject value to set. + * @return the Certificate object itself. + */ + public Certificate withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Certificate expiration date. + * + * @param expirationDate the expirationDate value to set. + * @return the Certificate object itself. + */ + public Certificate withExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the Certificate object itself. + */ + public Certificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + 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/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..e1ca7b568c70c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateSource.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CertificateSource. */ +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); + } + + /** @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..494d3c3209f1e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CertificateType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CertificateType. */ +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); + } + + /** @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/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..dca17e958954f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CheckNameAvailabilityInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of CheckNameAvailability API. */ +@Fluent +public final class CheckNameAvailabilityInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityInput.class); + + /* + * 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 String type; + + /** Creates an instance of CheckNameAvailabilityInput class. */ + public CheckNameAvailabilityInput() { + type = "Microsoft.Cdn/Profiles/Endpoints"; + } + + /** + * 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 String 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(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); + } + } +} 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..339e779728b22 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CIDR Ip address. */ +@Fluent +public final class CidrIpAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CidrIpAddress.class); + + /* + * Ip address itself. + */ + @JsonProperty(value = "baseIpAddress") + private String baseIpAddress; + + /* + * The length of the prefix of the ip address. + */ + @JsonProperty(value = "prefixLength") + private Integer prefixLength; + + /** + * 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/Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems.java new file mode 100644 index 0000000000000..8a0020d3aad8c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems model. */ +@Fluent +public final class Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems.class); + + /* + * The dateTime property. + */ + @JsonProperty(value = "dateTime") + private OffsetDateTime dateTime; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Float value; + + /** + * 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 Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems object itself. + */ + public Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems 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 Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems object itself. + */ + public Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems 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/Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems.java new file mode 100644 index 0000000000000..eff83974caa9d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems model. */ +@Fluent +public final class Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems.class); + + /* + * The dateTime property. + */ + @JsonProperty(value = "dateTime") + private OffsetDateTime dateTime; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private Float value; + + /** + * 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 Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems object itself. + */ + public Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems 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 Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems object itself. + */ + public Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems 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/ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems.java new file mode 100644 index 0000000000000..5b476b57a252d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems model. */ +@Fluent +public final class ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems.class); + + /* + * 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; + + /** + * 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 ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems object itself. + */ + public ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems 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 ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems object itself. + */ + public ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems 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 ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems object itself. + */ + public ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems 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/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..197f0b4c927bc --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContinentsResponseContinentsItem model. */ +@Fluent +public final class ContinentsResponseContinentsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinentsResponseContinentsItem.class); + + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..cbe45776a57a6 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContinentsResponseCountryOrRegionsItem model. */ +@Fluent +public final class ContinentsResponseCountryOrRegionsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContinentsResponseCountryOrRegionsItem.class); + + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The continentId property. + */ + @JsonProperty(value = "continentId") + private String continentId; + + /** + * 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..9f44aff5eaa46 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesMatchConditionParameters.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for Cookies match conditions. */ +@Fluent +public final class CookiesMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CookiesMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the CookiesMatchConditionParameters object itself. + */ + public CookiesMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..b56022962e032 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CookiesOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CookiesOperator. */ +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); + } + + /** @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..644d4c93fdc59 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomain.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 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 Custom Https 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 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 the custom domain. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 the response. + */ + 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 the response. + */ + Response disableCustomHttpsWithResponse(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 the response. + */ + 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 the response. + */ + Response enableCustomHttpsWithResponse( + 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..deae95a5cee7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainHttpsParameters.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainHttpsParameters.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..ad39e57b39082 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.CustomDomainInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainListResult.class); + + /* + * 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; + + /** + * 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..298983646e6e4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainParameters.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.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The customDomain JSON object required for custom domain creation or update. */ +@JsonFlatten +@Fluent +public class CustomDomainParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainParameters.class); + + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "properties.hostName") + private String hostname; + + /** + * 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 CustomDomainParameters object itself. + */ + public CustomDomainParameters withHostname(String hostname) { + this.hostname = hostname; + 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/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..0ee66ab2a4c29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomainResourceState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomDomainResourceState. */ +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); + } + + /** @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..074f9317c5c46 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomDomains.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + 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. + */ + 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 the response. + */ + 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 the response. + */ + Response disableCustomHttpsWithResponse( + 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 response. + */ + 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 the response. + */ + Response enableCustomHttpsWithResponse( + 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. + */ + 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. + */ + 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..8fc87258ab3e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomHttpsProvisioningState. */ +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); + } + + /** @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..c95c940406637 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomHttpsProvisioningSubstate.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomHttpsProvisioningSubstate. */ +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); + } + + /** @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..fb83417cf001d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the common attributes for a custom rule that can be included in a waf policy. */ +@Fluent +public class CustomRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRule.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..3fac750a04c03 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomRuleEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CustomRuleEnabledState. */ +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); + } + + /** @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..22a1cc458dff1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of custom rules. */ +@Fluent +public final class CustomRuleList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomRuleList.class); + + /* + * List of rules + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * 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..9ad467ad36736 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificate.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Customer Certificate used for https. */ +@Fluent +public final class CustomerCertificate extends Certificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerCertificate.class); + + /* + * Certificate version. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Certificate issuing authority. + */ + @JsonProperty(value = "certificateAuthority") + private String certificateAuthority; + + /* + * Complete Url to the certificate + */ + @JsonProperty(value = "certificateUrl", required = true) + private String certificateUrl; + + /* + * 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; + + /** + * Get the version property: Certificate version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Certificate version. + * + * @param version the version value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: Certificate issuing authority. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withCertificateAuthority(String certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + /** + * Get the certificateUrl property: Complete Url to the certificate. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: Complete Url to the certificate. + * + * @param certificateUrl the certificateUrl value to set. + * @return the CustomerCertificate object itself. + */ + public CustomerCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + 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 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; + } + + /** {@inheritDoc} */ + @Override + public CustomerCertificate withSubject(String subject) { + super.withSubject(subject); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomerCertificate withExpirationDate(String expirationDate) { + super.withExpirationDate(expirationDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomerCertificate withThumbprint(String thumbprint) { + super.withThumbprint(thumbprint); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (certificateUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateUrl in model CustomerCertificate")); + } + } +} 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..f60f544b56976 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/CustomerCertificateParameters.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerCertificateParameters.class); + + /* + * Resource reference to the KV secret + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /* + * Certificate issuing authority. + */ + @JsonProperty(value = "certificateAuthority") + 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; + + /** + * Get the secretSource property: Resource reference to the KV secret. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the KV secret. + * + * @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 certificateAuthority property: Certificate issuing authority. + * + * @return the certificateAuthority value. + */ + public String certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: Certificate issuing authority. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the CustomerCertificateParameters object itself. + */ + public CustomerCertificateParameters withCertificateAuthority(String certificateAuthority) { + this.certificateAuthority = certificateAuthority; + 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 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; + } + + /** + * 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(); + } + } +} 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..d24746b15b3b3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeepCreatedOrigin.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The main origin of CDN content which is added when creating a CDN endpoint. */ +@JsonFlatten +@Fluent +public class DeepCreatedOrigin { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeepCreatedOrigin.class); + + /* + * Origin name which must be unique within the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * 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 = "properties.hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000 + */ + @JsonProperty(value = "properties.weight") + private Integer weight; + + /* + * Origin is enabled for load balancing or not. By default, origin is + * always enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private' + */ + @JsonProperty(value = "properties.privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private' + */ + @JsonProperty(value = "properties.privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "properties.privateLinkLocation") + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to + * the Private Link. + */ + @JsonProperty(value = "properties.privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /** + * 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 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin 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 DeepCreatedOrigin object itself. + */ + public DeepCreatedOrigin withPrivateLinkApprovalMessage(String privateLinkApprovalMessage) { + this.privateLinkApprovalMessage = privateLinkApprovalMessage; + 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 DeepCreatedOrigin")); + } + } +} 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..b0d1431733fca --- /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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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. + */ +@JsonFlatten +@Fluent +public class DeepCreatedOriginGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeepCreatedOriginGroup.class); + + /* + * Origin group name which must be unique within the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Health probe settings to the origin that is used to determine the health + * of the origin. + */ + @JsonProperty(value = "properties.healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin + * group. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.responseBasedOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** + * 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 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 DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup 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 DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup 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 DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup 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 DeepCreatedOriginGroup object itself. + */ + public DeepCreatedOriginGroup withResponseBasedOriginErrorDetectionSettings( + ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings) { + this.responseBasedOriginErrorDetectionSettings = 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 (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/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..55a815b9c1497 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeleteRule.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeleteRule. */ +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); + } + + /** @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..9446ec55c6beb --- /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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRule.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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..a05f172e58322 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleAction.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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) +}) +@Immutable +public class DeliveryRuleAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleAction.class); + + /** + * 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..026ea8353815f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleActionValue.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeliveryRuleActionValue. */ +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"); + + /** + * 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); + } + + /** @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..3c7ff9a68596c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheExpirationAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleCacheExpirationAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private CacheExpirationActionParameters parameters; + + /** + * 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(); + } + } +} 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..7843965848b1c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCacheKeyQueryStringAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleCacheKeyQueryStringAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private CacheKeyQueryStringActionParameters parameters; + + /** + * 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(); + } + } +} 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..f7d10eac2c9dd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCondition.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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) +}) +@Immutable +public class DeliveryRuleCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleCondition.class); + + /** + * 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..96efa5e183285 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleCookiesCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleCookiesCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private CookiesMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..7a670a8d54a98 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleHttpVersionCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleHttpVersionCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private HttpVersionMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..3a4165fa83456 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleIsDeviceCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleIsDeviceCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private IsDeviceMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..fd822281eaab0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRulePostArgsCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRulePostArgsCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private PostArgsMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..3abe381b319e0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleQueryStringCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleQueryStringCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private QueryStringMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..78f9606c2e2d6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRemoteAddressCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRemoteAddressCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RemoteAddressMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..c845a6f7da6d8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestBodyCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestBodyCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestBodyMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..11b0f747bf72c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestHeaderAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private HeaderActionParameters parameters; + + /** + * 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(); + } + } +} 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..b6365fa277b14 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestHeaderCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestHeaderCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestHeaderMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..4f597d0922edc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestMethodCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestMethodCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestMethodMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..24d16a0ff5db0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestSchemeCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestSchemeCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestSchemeMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..e08ddc7bd3d08 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleRequestUriCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleRequestUriCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private RequestUriMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..f28df654e7e2c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleResponseHeaderAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleResponseHeaderAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private HeaderActionParameters parameters; + + /** + * 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(); + } + } +} 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..ee08a7898a139 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileExtensionCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleUrlFileExtensionCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlFileExtensionMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..86b231ff9c84c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlFileNameCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleUrlFileNameCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlFileNameMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..a37b0c56eb353 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeliveryRuleUrlPathCondition.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryRuleUrlPathCondition.class); + + /* + * Defines the parameters for the condition. + */ + @JsonProperty(value = "parameters", required = true) + private UrlPathMatchConditionParameters parameters; + + /** + * 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(); + } + } +} 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..acdaaa2c83dfb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DeploymentStatus.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.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); + } + + /** @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..0a0623f8e984f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DestinationProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DestinationProtocol. */ +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); + } + + /** @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/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..cf63e7895b3be --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to validate a domain. */ +@Immutable +public final class DomainValidationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainValidationProperties.class); + + /* + * 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; + + /** + * 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..fe600884056fe --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/DomainValidationState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DomainValidationState. */ +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 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"); + + /** + * 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); + } + + /** @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..089778a803f0e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EdgeNode.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.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 ipAddressGroups property: List of ip address groups. + * + * @return the ipAddressGroups value. + */ + List ipAddressGroups(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..8acd881ccbca2 --- /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. + */ + 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. + */ + 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..7bc604e23f92d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.EdgeNodeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgenodeResult.class); + + /* + * 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; + + /** + * 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..bea73488ec4f4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnabledState. */ +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); + } + + /** @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..d0b12f1dccc31 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Endpoint.java @@ -0,0 +1,904 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 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 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. + */ + String provisioningState(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.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.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, + DefinitionStages.WithOrigins, + DefinitionStages.WithOriginGroups { + /** + * 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 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); + } + /** 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); + } + } + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response validateCustomDomainWithResponse( + ValidateCustomDomainInput customDomainProperties, Context context); + + /** + * 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. + */ + 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. + */ + 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..b31fb59c2c96e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.EndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointListResult.class); + + /* + * 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; + + /** + * 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/EndpointProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProperties.java new file mode 100644 index 0000000000000..5266d4facb00b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointProperties.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointProperties.class); + + /* + * 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; + + /* + * 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 String provisioningState; + + /** + * 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 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 String 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()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..0a51118fbd72b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParameters.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object containing endpoint update parameters. */ +@Fluent +public class EndpointPropertiesUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointPropertiesUpdateParameters.class); + + /* + * 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; + + /** + * 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/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..8fac71b35a5e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersDeliveryPolicy.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.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(EndpointPropertiesUpdateParametersDeliveryPolicy.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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..2d146c362e89a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Web Application Firewall policy for the endpoint (if applicable). */ +@Fluent +public final class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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/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..0135598e1f68a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointResourceState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EndpointResourceState. */ +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); + } + + /** @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..4846dc01569db --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/EndpointUpdateParameters.java @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties required to create or update an endpoint. */ +@JsonFlatten +@Fluent +public class EndpointUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointUpdateParameters.class); + + /* + * Endpoint tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * A directory path on the origin that CDN can use to retrieve content + * from, e.g. contoso.cloudapp.net/originpath. + */ + @JsonProperty(value = "properties.originPath") + private String originPath; + + /* + * List of content types on which compression applies. The value should be + * a valid MIME type. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.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 = "properties.geoFilters") + private List geoFilters; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "properties.defaultOriginGroup") + private ResourceReference defaultOriginGroup; + + /* + * List of keys used to validate the signed URL hashes. + */ + @JsonProperty(value = "properties.urlSigningKeys") + private List urlSigningKeys; + + /* + * A policy that specifies the delivery rules to be used for an endpoint. + */ + @JsonProperty(value = "properties.deliveryPolicy") + private EndpointPropertiesUpdateParametersDeliveryPolicy deliveryPolicy; + + /* + * Defines the Web Application Firewall policy for the endpoint (if + * applicable) + */ + @JsonProperty(value = "properties.webApplicationFirewallPolicyLink") + private EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink; + + /** + * 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 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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 EndpointUpdateParameters object itself. + */ + public EndpointUpdateParameters 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/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..187e00350e0a4 --- /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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response validateCustomDomainWithResponse( + String resourceGroupName, + String profileName, + String endpointName, + ValidateCustomDomainInput customDomainProperties, + Context 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 com.azure.core.management.exception.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. + */ + 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. + */ + 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. + */ + 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. + */ + 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..9312f6efa1eee --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ForwardingProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ForwardingProtocol. */ +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); + } + + /** @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..c1385d367ee44 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilter.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rules defining user's geo access within a CDN endpoint. */ +@Fluent +public final class GeoFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoFilter.class); + + /* + * 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 codes defining user country access in a geo filter, + * e.g. AU, MX, US. + */ + @JsonProperty(value = "countryCodes", required = true) + private List countryCodes; + + /** + * 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 codes defining user country 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 codes defining user country 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")); + } + } +} 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..a77341999b68f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/GeoFilterActions.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for GeoFilterActions. */ +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) { + GeoFilterActions[] items = GeoFilterActions.values(); + for (GeoFilterActions item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..77cdb0065101e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderAction.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HeaderAction. */ +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); + } + + /** @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..63a91f3029b91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HeaderActionParameters.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the request header action. */ +@Fluent +public final class HeaderActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HeaderActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the HeaderActionParameters object itself. + */ + public HeaderActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..4841e9c009ca7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties to send health probes to origin. */ +@Fluent +public final class HealthProbeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HealthProbeParameters.class); + + /* + * 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; + + /** + * 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..dc4a2cb2231e1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HealthProbeRequestType.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HealthProbeRequestType. */ +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) { + HealthProbeRequestType[] items = HealthProbeRequestType.values(); + for (HealthProbeRequestType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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/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..29cc94aa2cbdf --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that represents the range for http status codes. */ +@Fluent +public final class HttpErrorRangeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpErrorRangeParameters.class); + + /* + * 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; + + /** + * 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..9c14365dbe84b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionMatchConditionParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for HttpVersion match conditions. */ +@Fluent +public final class HttpVersionMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpVersionMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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; + + /** Creates an instance of HttpVersionMatchConditionParameters class. */ + public HttpVersionMatchConditionParameters() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the HttpVersionMatchConditionParameters object itself. + */ + public HttpVersionMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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; + } + + /** + * 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")); + } + } +} 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..dcf03e43acbf0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpVersionOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpVersionOperator. */ +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); + } + + /** @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..440ff31375c88 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/HttpsRedirect.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpsRedirect. */ +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); + } + + /** @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/IdentityType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IdentityType.java new file mode 100644 index 0000000000000..2f7e31638d46e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IdentityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityType. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value user for IdentityType. */ + public static final IdentityType USER = fromString("user"); + + /** Static value application for IdentityType. */ + public static final IdentityType APPLICATION = fromString("application"); + + /** Static value managedIdentity for IdentityType. */ + public static final IdentityType MANAGED_IDENTITY = fromString("managedIdentity"); + + /** Static value key for IdentityType. */ + public static final IdentityType KEY = fromString("key"); + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** @return known IdentityType values. */ + public static Collection values() { + return values(IdentityType.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..160740a5a61b5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CDN Ip address group. */ +@Fluent +public final class IpAddressGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddressGroup.class); + + /* + * 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; + + /** + * 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..5875f10236925 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for IsDevice match conditions. */ +@Fluent +public final class IsDeviceMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IsDeviceMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the IsDeviceMatchConditionParameters object itself. + */ + public IsDeviceMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..05a4a18ce41da --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceMatchConditionParametersMatchValuesItem.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 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); + } + + /** @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..7db72ab9fa248 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/IsDeviceOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IsDeviceOperator. */ +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); + } + + /** @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..46bc8e50e0b91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultCertificateSourceParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters for using a user's KeyVault certificate for securing custom domain. */ +@Fluent +public final class KeyVaultCertificateSourceParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultCertificateSourceParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the KeyVaultCertificateSourceParameters object itself. + */ + public KeyVaultCertificateSourceParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..d729b427a3b82 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/KeyVaultSigningKeyParameters.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters for using a user's KeyVault for URL Signing Key. */ +@Fluent +public final class KeyVaultSigningKeyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultSigningKeyParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the KeyVaultSigningKeyParameters object itself. + */ + public KeyVaultSigningKeyParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..b8b032826bd18 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LinkToDefaultDomain.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinkToDefaultDomain. */ +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); + } + + /** @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..512cb0a302701 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadBalancingSettingsParameters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Round-Robin load balancing settings for a backend pool. */ +@Fluent +public final class LoadBalancingSettingsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingSettingsParameters.class); + + /* + * 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; + + /** + * 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..26df9e472cb1f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LoadParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content load. */ +@Fluent +public final class LoadParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadParameters.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..14f50689b4c4c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogAnalytics.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 CDN profile 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 report for AFD 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 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. + */ + 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 analytics ranking report for AFD 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 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 log analytics ranking report for AFD 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 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. + */ + Response getLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List rankings, + List metrics, + int maxRanking, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + List customDomains, + 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 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 all available location names for AFD log analytics report. + */ + ContinentsResponse getLogAnalyticsLocations(String resourceGroupName, String profileName); + + /** + * 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 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 all available location names for AFD log analytics report. + */ + Response getLogAnalyticsLocationsWithResponse( + 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 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 all endpoints and custom domains available for AFD log report. + */ + ResourcesResponse getLogAnalyticsResources(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 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 all endpoints and custom domains available for AFD log report. + */ + Response getLogAnalyticsResourcesWithResponse( + String resourceGroupName, String profileName, 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 CDN profile 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 related log analytics report for AFD 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 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. + */ + Response getWafLogAnalyticsMetricsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + WafGranularity granularity, + List actions, + List groupBy, + 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 CDN profile 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); + + /** + * Get WAF log analytics charts for AFD 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 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. + */ + Response getWafLogAnalyticsRankingsWithResponse( + String resourceGroupName, + String profileName, + List metrics, + OffsetDateTime dateTimeBegin, + OffsetDateTime dateTimeEnd, + int maxRanking, + List rankings, + List actions, + List ruleTypes, + Context context); +} 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..7685b682f0dd1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetric.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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); + } + + /** @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..f4c61aa710c96 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGranularity.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.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); + } + + /** @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..4daf805e9962d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogMetricsGroupBy.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.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 country for LogMetricsGroupBy. */ + public static final LogMetricsGroupBy COUNTRY = fromString("country"); + + /** 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); + } + + /** @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..e80c645ee5214 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRanking.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.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); + } + + /** @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..ba4971b5c8c4f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/LogRankingMetric.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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); + } + + /** @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/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..deac3542f5bb4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificate.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Managed Certificate used for https. */ +@Immutable +public final class ManagedCertificate extends Certificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedCertificate.class); + + /** {@inheritDoc} */ + @Override + public ManagedCertificate withSubject(String subject) { + super.withSubject(subject); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedCertificate withExpirationDate(String expirationDate) { + super.withExpirationDate(expirationDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedCertificate withThumbprint(String thumbprint) { + super.withThumbprint(thumbprint); + 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..3cf21e9ee5caa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedCertificateParameters.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedCertificateParameters.class); + + /** + * 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..5c8ad94032559 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a managed rule definition. */ +@Immutable +public final class ManagedRuleDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleDefinition.class); + + /* + * 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; + + /** + * 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..2c639f75b5fdb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleEnabledState. */ +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); + } + + /** @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..a296c39493245 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a managed rule group. */ +@Immutable +public final class ManagedRuleGroupDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupDefinition.class); + + /* + * 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; + + /** + * 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..27ef954956c24 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleGroupOverride.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupOverride.class); + + /* + * 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 disabled. If none specified, all rules in the + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * 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 disabled. 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 disabled. 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()); + } + } +} 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..21076422e6afc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleOverride.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleOverride.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..12417795771bb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSet.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSet.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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..581f81576a8b7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSetDefinition.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.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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..087dc3344683b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.ManagedRuleSetDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetDefinitionList.class); + + /* + * 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; + + /** + * 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..d237ded3a59be --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSetList.class); + + /* + * List of rule sets. + */ + @JsonProperty(value = "managedRuleSets") + private List managedRuleSets; + + /** + * 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..476c582915bd1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ManagedRuleSets.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 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. + */ + 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. + */ + PagedIterable list(Context context); +} 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..40cbf5a8bca3a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchCondition.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define match conditions. */ +@Fluent +public final class MatchCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchCondition.class); + + /* + * Match variable to compare against. + */ + @JsonProperty(value = "matchVariable", required = true) + private MatchVariable 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; + + /** + * Get the matchVariable property: Match variable to compare against. + * + * @return the matchVariable value. + */ + public MatchVariable 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(MatchVariable 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")); + } + } +} 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..8715ab889a243 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchProcessingBehavior.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MatchProcessingBehavior. */ +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); + } + + /** @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..d46e7568249fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MatchVariable.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MatchVariable. */ +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 RemoteAddr for MatchVariable. */ + public static final MatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value SocketAddr for MatchVariable. */ + public static final MatchVariable SOCKET_ADDR = fromString("SocketAddr"); + + /** + * 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); + } + + /** @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/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..61c0ce2593d23 --- /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. + */ + MetricsResponseGranularity 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/MetricsResponseGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseGranularity.java new file mode 100644 index 0000000000000..4c431d2cb08fa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseGranularity.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricsResponseGranularity. */ +public final class MetricsResponseGranularity extends ExpandableStringEnum { + /** Static value PT5M for MetricsResponseGranularity. */ + public static final MetricsResponseGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for MetricsResponseGranularity. */ + public static final MetricsResponseGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for MetricsResponseGranularity. */ + public static final MetricsResponseGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a MetricsResponseGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsResponseGranularity. + */ + @JsonCreator + public static MetricsResponseGranularity fromString(String name) { + return fromString(name, MetricsResponseGranularity.class); + } + + /** @return known MetricsResponseGranularity values. */ + public static Collection values() { + return values(MetricsResponseGranularity.class); + } +} 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..60c833e1b7d93 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MetricsResponseSeriesItem model. */ +@Fluent +public final class MetricsResponseSeriesItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricsResponseSeriesItem.class); + + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private MetricsResponseSeriesItemUnit unit; + + /* + * The groups property. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** + * 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 MetricsResponseSeriesItemUnit 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(MetricsResponseSeriesItemUnit 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/MetricsResponseSeriesItemUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemUnit.java new file mode 100644 index 0000000000000..75ab45456aaae --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MetricsResponseSeriesItemUnit.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricsResponseSeriesItemUnit. */ +public final class MetricsResponseSeriesItemUnit extends ExpandableStringEnum { + /** Static value count for MetricsResponseSeriesItemUnit. */ + public static final MetricsResponseSeriesItemUnit COUNT = fromString("count"); + + /** Static value bytes for MetricsResponseSeriesItemUnit. */ + public static final MetricsResponseSeriesItemUnit BYTES = fromString("bytes"); + + /** Static value bitsPerSecond for MetricsResponseSeriesItemUnit. */ + public static final MetricsResponseSeriesItemUnit BITS_PER_SECOND = fromString("bitsPerSecond"); + + /** + * Creates or finds a MetricsResponseSeriesItemUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsResponseSeriesItemUnit. + */ + @JsonCreator + public static MetricsResponseSeriesItemUnit fromString(String name) { + return fromString(name, MetricsResponseSeriesItemUnit.class); + } + + /** @return known MetricsResponseSeriesItemUnit values. */ + public static Collection values() { + return values(MetricsResponseSeriesItemUnit.class); + } +} 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..7e9be7c0117f7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MetricsResponseSeriesPropertiesItemsItem model. */ +@Fluent +public final class MetricsResponseSeriesPropertiesItemsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricsResponseSeriesPropertiesItemsItem.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /** + * 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/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..0472616185663 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/MinimumTlsVersion.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for MinimumTlsVersion. */ +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) { + MinimumTlsVersion[] items = MinimumTlsVersion.values(); + for (MinimumTlsVersion item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..cfa6b52d9be92 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operation.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.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the 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..2c7fdf7e572f8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationDisplay.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..5a6e00640dcb2 --- /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. + */ + 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. + */ + 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..c99492ff15cfb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OperationsListResult.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListResult.class); + + /* + * List of CDN operations supported by the CDN resource provider. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of CDN operations supported by the CDN resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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..30c4b76f3022b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Operator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Operator. */ +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); + } + + /** @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..4731e35ffeced --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OptimizationType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OptimizationType. */ +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); + } + + /** @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..d13f375d40118 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Origin.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 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. + */ + String provisioningState(); + + /** + * Gets the privateEndpointStatus property: The approval status for the connection to the Private Link. + * + * @return the privateEndpointStatus value. + */ + PrivateEndpointStatus privateEndpointStatus(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..bcfa35d4a7849 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroup.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.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 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 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. + */ + String provisioningState(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..ad0a951c919a9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupListResult.class); + + /* + * 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; + + /** + * 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/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..92cab832e64c2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupOverrideAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private OriginGroupOverrideActionParameters parameters; + + /** + * 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(); + } + } +} 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..8801cd085c53a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupOverrideActionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the origin group override action. */ +@Fluent +public final class OriginGroupOverrideActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupOverrideActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * defines the OriginGroup that would override the DefaultOriginGroup. + */ + @JsonProperty(value = "originGroup", required = true) + private ResourceReference originGroup; + + /** Creates an instance of OriginGroupOverrideActionParameters class. */ + public OriginGroupOverrideActionParameters() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleOriginGroupOverrideActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the OriginGroupOverrideActionParameters object itself. + */ + public OriginGroupOverrideActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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(); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProperties.java new file mode 100644 index 0000000000000..015aaf705290c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupProperties.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the origin group. */ +@Immutable +public final class OriginGroupProperties extends OriginGroupUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupProperties.class); + + /* + * 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 String provisioningState; + + /** + * 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 String 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/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..f6c9ded8347f3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupResourceState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OriginGroupResourceState. */ +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); + } + + /** @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..5a4706df6f559 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdateParameters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Origin group properties needed for origin group creation or update. */ +@JsonFlatten +@Fluent +public class OriginGroupUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupUpdateParameters.class); + + /* + * Health probe settings to the origin that is used to determine the health + * of the origin. + */ + @JsonProperty(value = "properties.healthProbeSettings") + private HealthProbeParameters healthProbeSettings; + + /* + * The source of the content being delivered via CDN within given origin + * group. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.responseBasedOriginErrorDetectionSettings") + private ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings; + + /** + * 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 OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters 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 OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters 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 OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters 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 OriginGroupUpdateParameters object itself. + */ + public OriginGroupUpdateParameters 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/models/OriginGroupUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginGroupUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..996db7a829284 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the origin group. */ +@Fluent +public class OriginGroupUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginGroupUpdatePropertiesParameters.class); + + /* + * 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; + + /** + * 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/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..b6ec721019aef --- /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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + 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. + */ + 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. + */ + 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. + */ + 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..eb826eb409c93 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.OriginInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginListResult.class); + + /* + * 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; + + /** + * 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/OriginProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProperties.java new file mode 100644 index 0000000000000..d7903110dbdbc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginProperties.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Immutable +public final class OriginProperties extends OriginUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginProperties.class); + + /* + * 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 String provisioningState; + + /* + * The approval status for the connection to the Private Link + */ + @JsonProperty(value = "privateEndpointStatus", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointStatus privateEndpointStatus; + + /** + * 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 String 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/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..546111e1c11b2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginResourceState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OriginResourceState. */ +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); + } + + /** @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..070bf037ab5c0 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdateParameters.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Origin properties needed for origin update. */ +@JsonFlatten +@Fluent +public class OriginUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginUpdateParameters.class); + + /* + * 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 = "properties.hostName") + private String hostname; + + /* + * The value of the HTTP port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.httpPort") + private Integer httpPort; + + /* + * The value of the HTTPS port. Must be between 1 and 65535. + */ + @JsonProperty(value = "properties.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 = "properties.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 = "properties.priority") + private Integer priority; + + /* + * Weight of the origin in given origin group for load balancing. Must be + * between 1 and 1000 + */ + @JsonProperty(value = "properties.weight") + private Integer weight; + + /* + * Origin is enabled for load balancing or not + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * The Alias of the Private Link resource. Populating this optional field + * indicates that this origin is 'Private' + */ + @JsonProperty(value = "properties.privateLinkAlias") + private String privateLinkAlias; + + /* + * The Resource Id of the Private Link resource. Populating this optional + * field indicates that this backend is 'Private' + */ + @JsonProperty(value = "properties.privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The location of the Private Link resource. Required only if + * 'privateLinkResourceId' is populated + */ + @JsonProperty(value = "properties.privateLinkLocation") + private String privateLinkLocation; + + /* + * A custom message to be included in the approval request to connect to + * the Private Link. + */ + @JsonProperty(value = "properties.privateLinkApprovalMessage") + private String privateLinkApprovalMessage; + + /** + * 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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 OriginUpdateParameters object itself. + */ + public OriginUpdateParameters 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/models/OriginUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..dbc596f8c21aa --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/OriginUpdatePropertiesParameters.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JSON object that contains the properties of the origin. */ +@Fluent +public class OriginUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OriginUpdatePropertiesParameters.class); + + /* + * 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; + + /** + * 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/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..067209550def0 --- /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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + 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. + */ + 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. + */ + 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. + */ + 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..8cf4ced42a05f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ParamIndicator.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ParamIndicator. */ +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); + } + + /** @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..4a13a97483567 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Policies.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getByResourceGroupWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String policyName, Context context); + + /** + * 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. + */ + 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. + */ + 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 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..54ff1ef443bf1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyEnabledState. */ +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); + } + + /** @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..c188a179a6de6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyMode. */ +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); + } + + /** @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..cc056b5d1f889 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicyResourceState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyResourceState. */ +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); + } + + /** @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..df04b4329089d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettings.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines contents of a web application firewall global configuration. */ +@Fluent +public final class PolicySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySettings.class); + + /* + * 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; + + /** + * 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..e225f6d0a4cd2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PolicySettingsDefaultCustomBlockResponseStatusCode.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 PolicySettingsDefaultCustomBlockResponseStatusCode. */ +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); + } + + /** @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..5b8ed22e197f1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsMatchConditionParameters.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for PostArgs match conditions. */ +@Fluent +public final class PostArgsMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PostArgsMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the PostArgsMatchConditionParameters object itself. + */ + public PostArgsMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..7b73eb76e6894 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PostArgsOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PostArgsOperator. */ +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); + } + + /** @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..cb7455b50bd99 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PrivateEndpointStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointStatus. */ +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); + } + + /** @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..1b1a147c24b64 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProbeProtocol.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProbeProtocol. */ +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) { + ProbeProtocol[] items = ProbeProtocol.values(); + for (ProbeProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..31cbffe76f919 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profile.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.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.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 a CDN provider, feature list and rate) of the CDN profile. + * + * @return the sku value. + */ + Sku sku(); + + /** + * 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. + */ + String provisioningState(); + + /** + * Gets the frontdoorId property: The Id of the frontdoor. + * + * @return the frontdoorId value. + */ + String frontdoorId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.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 a CDN provider, feature list and rate) of the CDN + * profile.. + * + * @param sku The pricing tier (defines a CDN provider, feature list and rate) of the CDN 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 { + /** + * 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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); + + /** + * 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(); + + /** + * 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. + */ + Response generateSsoUriWithResponse(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(); + + /** + * 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. + */ + Response listSupportedOptimizationTypesWithResponse(Context context); + + /** + * Checks the quota and actual usage of endpoints under the given 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. + */ + PagedIterable listResourceUsage(); + + /** + * Checks the quota and actual usage of endpoints under the given 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. + */ + PagedIterable listResourceUsage(Context context); +} 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..8dadc22bbdcd0 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.ProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileListResult.class); + + /* + * 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; + + /** + * 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/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..5ca7999312ecb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileResourceState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProfileResourceState. */ +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"); + + /** + * 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); + } + + /** @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..57353069335c8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProfileUpdateParameters.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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties required to update a profile. */ +@Fluent +public final class ProfileUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProfileUpdateParameters.class); + + /* + * Profile tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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; + } + + /** + * 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/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..3b00a07ae1782 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Profiles.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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. + */ + PagedIterable list(); + + /** + * Lists all of the 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. + */ + PagedIterable list(Context context); + + /** + * Lists all of the 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a 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 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + Profile getByResourceGroup(String resourceGroupName, String profileName); + + /** + * Gets a 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 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String profileName, Context context); + + /** + * Deletes an existing 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 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 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 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); + + /** + * 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); + + /** + * 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. + */ + Response generateSsoUriWithResponse(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 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); + + /** + * 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 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. + */ + Response listSupportedOptimizationTypesWithResponse( + String resourceGroupName, String profileName, Context context); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 output of check resource usage API. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, Context context); + + /** + * Gets a 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + Profile getById(String id); + + /** + * Gets a 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 a CDN profile with the specified profile name under the specified subscription and resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing 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 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..be11595fa5330 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProtocolType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtocolType. */ +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); + } + + /** @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..3c3fbd6e7e4cd --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +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); + } + + /** @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..29dc320710cb4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/PurgeParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters required for content purge. */ +@Fluent +public final class PurgeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurgeParameters.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..e9153cbf03d76 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringBehavior.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for QueryStringBehavior. */ +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); + } + + /** @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..8fc850ba4a8c6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringCachingBehavior.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for QueryStringCachingBehavior. */ +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) { + QueryStringCachingBehavior[] items = QueryStringCachingBehavior.values(); + for (QueryStringCachingBehavior item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..2b327cb96c756 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for QueryString match conditions. */ +@Fluent +public final class QueryStringMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryStringMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the QueryStringMatchConditionParameters object itself. + */ + public QueryStringMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..7fbd527c79241 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/QueryStringOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for QueryStringOperator. */ +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); + } + + /** @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..ce471afe221f5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RankingsResponseTablesItem model. */ +@Fluent +public final class RankingsResponseTablesItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RankingsResponseTablesItem.class); + + /* + * The ranking property. + */ + @JsonProperty(value = "ranking") + private String ranking; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** + * 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..a85fe77d41e9f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RankingsResponseTablesPropertiesItemsItem model. */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RankingsResponseTablesPropertiesItemsItem.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The metrics property. + */ + @JsonProperty(value = "metrics") + private List metrics; + + /** + * 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..974ec7b37166d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RankingsResponseTablesPropertiesItemsMetricsItem.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RankingsResponseTablesPropertiesItemsMetricsItem model. */ +@Fluent +public final class RankingsResponseTablesPropertiesItemsMetricsItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RankingsResponseTablesPropertiesItemsMetricsItem.class); + + /* + * 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; + + /** + * 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..70e5509d095d9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RateLimitRule.class); + + /* + * 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; + + /** + * 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..b50333583f966 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of rate limit rules. */ +@Fluent +public final class RateLimitRuleList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RateLimitRuleList.class); + + /* + * List of rules + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * 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..77af74aadb5cc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RedirectType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RedirectType. */ +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); + } + + /** @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..e3e3c08070d75 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressMatchConditionParameters.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RemoteAddress match conditions. */ +@Fluent +public final class RemoteAddressMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RemoteAddressMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RemoteAddressMatchConditionParameters object itself. + */ + public RemoteAddressMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..a7aab74449949 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RemoteAddressOperator.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RemoteAddressOperator. */ +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); + } + + /** @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..ea9ce55299378 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestBody match conditions. */ +@Fluent +public final class RequestBodyMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestBodyMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RequestBodyMatchConditionParameters object itself. + */ + public RequestBodyMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..cd80f8f05e573 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestBodyOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestBodyOperator. */ +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); + } + + /** @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..d58c8e40f1c95 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderMatchConditionParameters.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestHeader match conditions. */ +@Fluent +public final class RequestHeaderMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestHeaderMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RequestHeaderMatchConditionParameters object itself. + */ + public RequestHeaderMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..91c43c546f9de --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestHeaderOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestHeaderOperator. */ +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); + } + + /** @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..ddd6f41e2aa9b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParameters.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestMethod match conditions. */ +@Fluent +public final class RequestMethodMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestMethodMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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; + + /* + * The match value for the condition of the delivery rule + */ + @JsonProperty(value = "matchValues") + private List matchValues; + + /** Creates an instance of RequestMethodMatchConditionParameters class. */ + public RequestMethodMatchConditionParameters() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RequestMethodMatchConditionParameters object itself. + */ + public RequestMethodMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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 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")); + } + } +} 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..c1d984e408f1b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodMatchConditionParametersMatchValuesItem.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 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); + } + + /** @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..a96c1978bba7f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestMethodOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestMethodOperator. */ +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); + } + + /** @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..dc80ea4c95f75 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestScheme match conditions. */ +@Fluent +public final class RequestSchemeMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestSchemeMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * Describes operator to be matched + */ + @JsonProperty(value = "operator", required = true) + private String 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; + + /** Creates an instance of RequestSchemeMatchConditionParameters class. */ + public RequestSchemeMatchConditionParameters() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters"; + operator = "Equal"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RequestSchemeMatchConditionParameters object itself. + */ + public RequestSchemeMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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 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..986527510780f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestSchemeMatchConditionParametersMatchValuesItem.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 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); + } + + /** @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..7176dc19d5a8f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for RequestUri match conditions. */ +@Fluent +public final class RequestUriMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestUriMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the RequestUriMatchConditionParameters object itself. + */ + public RequestUriMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..bb1777738d7a9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RequestUriOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequestUriOperator. */ +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); + } + + /** @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..c21cc855b0447 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourceProviders.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.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 + * 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. + */ + 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 checkNameAvailabilityWithSubscription( + 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. + */ + Response checkNameAvailabilityWithSubscriptionWithResponse( + CheckNameAvailabilityInput checkNameAvailabilityInput, 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); + + /** + * 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. + */ + Response validateProbeWithResponse(ValidateProbeInput validateProbeInput, Context context); +} 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..c6a028887a7e7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to another resource. */ +@Fluent +public final class ResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceReference.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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/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..c920b729934f0 --- /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. + */ + String 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..cdeb9b97707be --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.ResourceUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output of check resource usage API. */ +@Fluent +public final class ResourceUsageListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUsageListResult.class); + + /* + * 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; + + /** + * 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/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..4920229337ec1 --- /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. + */ + 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. + */ + 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..33ee591faa00e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourcesResponseCustomDomainsItem model. */ +@Fluent +public final class ResourcesResponseCustomDomainsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourcesResponseCustomDomainsItem.class); + + /* + * 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; + + /** + * 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..608e7304cc939 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourcesResponseEndpointsItem model. */ +@Fluent +public final class ResourcesResponseEndpointsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourcesResponseEndpointsItem.class); + + /* + * 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; + + /** + * 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..bfbd9ef612364 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResourcesResponseEndpointsPropertiesItemsItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourcesResponseEndpointsPropertiesItemsItem model. */ +@Fluent +public final class ResourcesResponseEndpointsPropertiesItemsItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ResourcesResponseEndpointsPropertiesItemsItem.class); + + /* + * 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; + + /** + * 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..f949d8cd16407 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedDetectedErrorTypes.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResponseBasedDetectedErrorTypes. */ +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) { + ResponseBasedDetectedErrorTypes[] items = ResponseBasedDetectedErrorTypes.values(); + for (ResponseBasedDetectedErrorTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..325d91755743e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ResponseBasedOriginErrorDetectionParameters.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties to determine origin health using real requests/responses. */ +@Fluent +public final class ResponseBasedOriginErrorDetectionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseBasedOriginErrorDetectionParameters.class); + + /* + * 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; + + /** + * 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..c3be475b20617 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Route.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.models; + +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 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 compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + Object compressionSettings(); + + /** + * 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. + */ + AfdQueryStringCachingBehavior queryStringCachingBehavior(); + + /** + * 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 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 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.WithCompressionSettings, + DefinitionStages.WithQueryStringCachingBehavior, + 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 compressionSettings. */ + interface WithCompressionSettings { + /** + * Specifies the compressionSettings property: compression settings.. + * + * @param compressionSettings compression settings. + * @return the next definition stage. + */ + WithCreate withCompressionSettings(Object compressionSettings); + } + /** The stage of the Route 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(AfdQueryStringCachingBehavior queryStringCachingBehavior); + } + /** 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.WithCompressionSettings, + UpdateStages.WithQueryStringCachingBehavior, + 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 compressionSettings. */ + interface WithCompressionSettings { + /** + * Specifies the compressionSettings property: compression settings.. + * + * @param compressionSettings compression settings. + * @return the next definition stage. + */ + Update withCompressionSettings(Object compressionSettings); + } + /** The stage of the Route 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(AfdQueryStringCachingBehavior queryStringCachingBehavior); + } + /** 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/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..dad7529cabfb6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.RouteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteListResult.class); + + /* + * 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; + + /** + * 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/RouteProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteProperties.java new file mode 100644 index 0000000000000..32684a790ad30 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the Routes to create. */ +@Immutable +public final class RouteProperties extends RouteUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteProperties.class); + + /* + * 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; + + /** + * 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 withCompressionSettings(Object compressionSettings) { + super.withCompressionSettings(compressionSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public RouteProperties withQueryStringCachingBehavior(AfdQueryStringCachingBehavior queryStringCachingBehavior) { + super.withQueryStringCachingBehavior(queryStringCachingBehavior); + 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/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..bc9a5564f9819 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdateParameters.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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The domain JSON object required for domain creation or update. */ +@JsonFlatten +@Fluent +public class RouteUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteUpdateParameters.class); + + /* + * Domains referenced by this endpoint. + */ + @JsonProperty(value = "properties.customDomains") + private List customDomains; + + /* + * A reference to the origin group. + */ + @JsonProperty(value = "properties.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 = "properties.originPath") + private String originPath; + + /* + * rule sets referenced by this endpoint. + */ + @JsonProperty(value = "properties.ruleSets") + private List ruleSets; + + /* + * List of supported protocols for this route. + */ + @JsonProperty(value = "properties.supportedProtocols") + private List supportedProtocols; + + /* + * The route patterns of the rule. + */ + @JsonProperty(value = "properties.patternsToMatch") + private List patternsToMatch; + + /* + * compression settings. + */ + @JsonProperty(value = "properties.compressionSettings") + private Object compressionSettings; + + /* + * 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 = "properties.queryStringCachingBehavior") + private AfdQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * Protocol this rule will use when forwarding traffic to backends. + */ + @JsonProperty(value = "properties.forwardingProtocol") + private ForwardingProtocol forwardingProtocol; + + /* + * whether this route will be linked to the default endpoint domain. + */ + @JsonProperty(value = "properties.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 = "properties.httpsRedirect") + private HttpsRedirect httpsRedirect; + + /* + * Whether to enable use of this rule. Permitted values are 'Enabled' or + * 'Disabled' + */ + @JsonProperty(value = "properties.enabledState") + private EnabledState enabledState; + + /** + * 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withPatternsToMatch(List patternsToMatch) { + this.patternsToMatch = patternsToMatch; + return this; + } + + /** + * Get the compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + public Object compressionSettings() { + return this.compressionSettings; + } + + /** + * Set the compressionSettings property: compression settings. + * + * @param compressionSettings the compressionSettings value to set. + * @return the RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withCompressionSettings(Object compressionSettings) { + this.compressionSettings = compressionSettings; + 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 AfdQueryStringCachingBehavior 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters withQueryStringCachingBehavior( + AfdQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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 RouteUpdateParameters object itself. + */ + public RouteUpdateParameters 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()); + } + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..baf82f03c3163 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RouteUpdatePropertiesParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the domain to create. */ +@Fluent +public class RouteUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteUpdatePropertiesParameters.class); + + /* + * 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; + + /* + * compression settings. + */ + @JsonProperty(value = "compressionSettings") + private Object compressionSettings; + + /* + * 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 AfdQueryStringCachingBehavior queryStringCachingBehavior; + + /* + * 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; + + /** + * 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 compressionSettings property: compression settings. + * + * @return the compressionSettings value. + */ + public Object compressionSettings() { + return this.compressionSettings; + } + + /** + * Set the compressionSettings property: compression settings. + * + * @param compressionSettings the compressionSettings value to set. + * @return the RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withCompressionSettings(Object compressionSettings) { + this.compressionSettings = compressionSettings; + 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 AfdQueryStringCachingBehavior 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 RouteUpdatePropertiesParameters object itself. + */ + public RouteUpdatePropertiesParameters withQueryStringCachingBehavior( + AfdQueryStringCachingBehavior queryStringCachingBehavior) { + this.queryStringCachingBehavior = queryStringCachingBehavior; + 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()); + } + } +} 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..c809b515ad54b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Routes.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 routes. + */ + 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 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 routes. + */ + 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 CDN 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); + + /** + * 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 CDN 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. + */ + Response getWithResponse( + 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 CDN 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 CDN 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. + */ + 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. + */ + 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..85955e7105471 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rule.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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/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..1ca8d2bbc106d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleListResult.class); + + /* + * 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; + + /** + * 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/RuleProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleProperties.java new file mode 100644 index 0000000000000..d6b2b01c7e6fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JSON object that contains the properties of the Rules to create. */ +@Immutable +public final class RuleProperties extends RuleUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleProperties.class); + + /* + * 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; + + /** + * 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/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..4f43a4a3db7cf --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSet.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.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 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 systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..26095b6dddfc8 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.RuleSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleSetListResult.class); + + /* + * 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; + + /** + * 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/RuleSetProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetProperties.java new file mode 100644 index 0000000000000..533e08e0acd2f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSetProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The JSON object that contains the properties of the Rule Set to create. */ +@Immutable +public final class RuleSetProperties extends AfdStateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleSetProperties.class); + + /** + * 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/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..5227c12a64ba3 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleSets.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.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 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 rule sets. + */ + 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 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 rule sets. + */ + 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 CDN 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); + + /** + * 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 CDN 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. + */ + Response getWithResponse( + 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 CDN 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); + + /** + * 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 CDN 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. + */ + RuleSet create(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 CDN 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 CDN 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 CDN 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 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. + */ + PagedIterable listResourceUsage(String resourceGroupName, String profileName, String ruleSetName); + + /** + * Checks the quota and actual usage of endpoints under the given CDN 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 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. + */ + 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..941c1ff52163f --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdateParameters.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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The domain JSON object required for domain creation or update. */ +@JsonFlatten +@Fluent +public class RuleUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleUpdateParameters.class); + + /* + * 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 = "properties.order") + private Integer order; + + /* + * A list of conditions that must be matched for the actions to be executed + */ + @JsonProperty(value = "properties.conditions") + private List conditions; + + /* + * A list of actions that are executed when all the conditions of a rule + * are satisfied. + */ + @JsonProperty(value = "properties.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 = "properties.matchProcessingBehavior") + private MatchProcessingBehavior matchProcessingBehavior; + + /** + * 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 RuleUpdateParameters object itself. + */ + public RuleUpdateParameters 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 RuleUpdateParameters object itself. + */ + public RuleUpdateParameters 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 RuleUpdateParameters object itself. + */ + public RuleUpdateParameters 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 RuleUpdateParameters object itself. + */ + public RuleUpdateParameters 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/models/RuleUpdatePropertiesParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdatePropertiesParameters.java new file mode 100644 index 0000000000000..fdf516ce7de41 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/RuleUpdatePropertiesParameters.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.JsonIgnore; +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 RuleUpdatePropertiesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuleUpdatePropertiesParameters.class); + + /* + * 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; + + /** + * 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/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..de51bce7ced91 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Rules.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 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 CDN 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. + */ + 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 CDN 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. + */ + 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 CDN 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); + + /** + * 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 CDN 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. + */ + Response getWithResponse( + 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 CDN 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 CDN 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. + */ + 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. + */ + 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..a9248cf7528a1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secret.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.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 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 parameters property: object which contains secret parameters. + * + * @return the parameters value. + */ + SecretParameters parameters(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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); + } + } + /** + * Begins update for the Secret resource. + * + * @return the stage of resource update. + */ + Secret.Update update(); + + /** The template for Secret update. */ + interface Update extends UpdateStages.WithParameters { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Secret apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Secret apply(Context context); + } + /** The Secret update stages. */ + interface UpdateStages { + /** The stage of the Secret update 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. + */ + Update 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..adb0f09b6099f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecretInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretListResult.class); + + /* + * 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; + + /** + * 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..b581993071d93 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretParameters.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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) +}) +@Immutable +public class SecretParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretParameters.class); + + /** + * 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/SecretProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretProperties.java new file mode 100644 index 0000000000000..b61cfb636ae6d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretProperties.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretProperties.class); + + /* + * object which contains secret parameters + */ + @JsonProperty(value = "parameters") + private SecretParameters parameters; + + /** + * 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/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..450137679c51b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecretType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecretType. */ +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"); + + /** + * 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); + } + + /** @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..f8df18bddc9c8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Secrets.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 secrets. + */ + 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 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 secrets. + */ + 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 CDN 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); + + /** + * Gets an existing Secret within a 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 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. + */ + Response getWithResponse(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 CDN 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 CDN 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. + */ + 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. + */ + 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..df8d54b7b98b2 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicies.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.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 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 security policies. + */ + 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 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 security policies. + */ + 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 CDN 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); + + /** + * Gets an existing security policy within a 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 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. + */ + Response getWithResponse( + 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 CDN profile which is unique within the resource group. + * @param securityPolicyName 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 securityPolicyName); + + /** + * Deletes an existing security policy within 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 securityPolicyName 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 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. + */ + 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. + */ + 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..bec09410543a6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicy.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.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 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 parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + SecurityPolicyParameters parameters(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 CDN 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(SecurityPolicyParameters 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(SecurityPolicyParameters 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..77d2cf714e7f6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.SecurityPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPolicyListResult.class); + + /* + * 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; + + /** + * 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/SecurityPolicyParameters.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyParameters.java new file mode 100644 index 0000000000000..f819c4dc3050a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyParameters.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = SecurityPolicyParameters.class) +@JsonTypeName("SecurityPolicyParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "WebApplicationFirewall", value = SecurityPolicyWebApplicationFirewallParameters.class) +}) +@Immutable +public class SecurityPolicyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPolicyParameters.class); + + /** + * 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/SecurityPolicyProperties.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyProperties.java new file mode 100644 index 0000000000000..1d50ec9ace0e7 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyProperties.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPolicyProperties.class); + + /* + * object which contains security policy parameters + */ + @JsonProperty(value = "parameters") + private SecurityPolicyParameters parameters; + + /** + * Get the parameters property: object which contains security policy parameters. + * + * @return the parameters value. + */ + public SecurityPolicyParameters 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(SecurityPolicyParameters 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/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..214672eb7c8b6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityPolicyType. */ +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); + } + + /** @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/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..53987f2c2169c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallAssociation.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** settings for security policy patterns to match. */ +@Fluent +public final class SecurityPolicyWebApplicationFirewallAssociation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityPolicyWebApplicationFirewallAssociation.class); + + /* + * List of domains. + */ + @JsonProperty(value = "domains") + private List domains; + + /* + * List of paths + */ + @JsonProperty(value = "patternsToMatch") + private List patternsToMatch; + + /** + * 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..4156ceab9f30c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SecurityPolicyWebApplicationFirewallParameters.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.JsonIgnore; +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 SecurityPolicyParameters { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SecurityPolicyWebApplicationFirewallParameters.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "wafPolicy") + private ResourceReference wafPolicy; + + /* + * Waf associations + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * 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/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..2c1908a159500 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SharedPrivateLinkResourceStatus.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SharedPrivateLinkResourceStatus. */ +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) { + SharedPrivateLinkResourceStatus[] items = SharedPrivateLinkResourceStatus.values(); + for (SharedPrivateLinkResourceStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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..efe1ad80a502e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Sku.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Name of the pricing tier. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** + * 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..88a289c42f353 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SkuName.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +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 Premium_ChinaCdn for SkuName. */ + public static final SkuName PREMIUM_CHINA_CDN = fromString("Premium_ChinaCdn"); + + /** 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); + } + + /** @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/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..6d59392a154e8 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Status.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for 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); + } + + /** @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/SystemData.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SystemData.java new file mode 100644 index 0000000000000..7db3c56c12532 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/SystemData.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Read only system data. */ +@Fluent +public final class SystemData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); + + /* + * An identifier for the identity that created the resource + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /* + * The type of identity that created the resource + */ + @JsonProperty(value = "createdByType") + private IdentityType createdByType; + + /* + * The timestamp of resource creation (UTC) + */ + @JsonProperty(value = "createdAt") + private OffsetDateTime createdAt; + + /* + * An identifier for the identity that last modified the resource + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /* + * The type of identity that last modified the resource + */ + @JsonProperty(value = "lastModifiedByType") + private IdentityType lastModifiedByType; + + /* + * The timestamp of resource last modification (UTC) + */ + @JsonProperty(value = "lastModifiedAt") + private OffsetDateTime lastModifiedAt; + + /** + * Get the createdBy property: An identifier for the identity that created the resource. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: An identifier for the identity that created the resource. + * + * @param createdBy the createdBy value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: The type of identity that created the resource. + * + * @return the createdByType value. + */ + public IdentityType createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of identity that created the resource. + * + * @param createdByType the createdByType value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedByType(IdentityType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: The timestamp of resource creation (UTC). + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: An identifier for the identity that last modified the resource. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: An identifier for the identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: The type of identity that last modified the resource. + * + * @return the lastModifiedByType value. + */ + public IdentityType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: The type of identity that last modified the resource. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedByType(IdentityType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + 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/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..b79228eaae21b --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Transform.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Transform. */ +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"); + + /** + * 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); + } + + /** @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..50110d5ee59c1 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/TransformType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TransformType. */ +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); + } + + /** @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..e45418af05d29 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UpdateRule.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateRule. */ +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); + } + + /** @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..559e5a1aba006 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlFileExtension match conditions. */ +@Fluent +public final class UrlFileExtensionMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlFileExtensionMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionMatchConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlFileExtensionMatchConditionParameters object itself. + */ + public UrlFileExtensionMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..704252f0a872e --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileExtensionOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UrlFileExtensionOperator. */ +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); + } + + /** @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..32f9486681902 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlFilename match conditions. */ +@Fluent +public final class UrlFileNameMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlFileNameMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFilenameConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlFileNameMatchConditionParameters object itself. + */ + public UrlFileNameMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..576c903820bbc --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlFileNameOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UrlFileNameOperator. */ +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); + } + + /** @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..571881f6b4267 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathMatchConditionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for UrlPath match conditions. */ +@Fluent +public final class UrlPathMatchConditionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlPathMatchConditionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathMatchConditionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlPathMatchConditionParameters object itself. + */ + public UrlPathMatchConditionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..7d517183243fb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlPathOperator.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UrlPathOperator. */ +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); + } + + /** @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..fb3d0fcf77d78 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlRedirectAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlRedirectActionParameters parameters; + + /** + * 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(); + } + } +} 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..1ecb12364a0b9 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRedirectActionParameters.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the url redirect action. */ +@Fluent +public final class UrlRedirectActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlRedirectActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRedirectActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlRedirectActionParameters object itself. + */ + public UrlRedirectActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..dd339e14f60ce --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlRewriteAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlRewriteActionParameters parameters; + + /** + * 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(); + } + } +} 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..7c36198c9299c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlRewriteActionParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the parameters for the url rewrite action. */ +@Fluent +public final class UrlRewriteActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlRewriteActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRewriteActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlRewriteActionParameters object itself. + */ + public UrlRewriteActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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")); + } + } +} 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..31db8bbe35043 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningAction.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlSigningAction.class); + + /* + * Defines the parameters for the action. + */ + @JsonProperty(value = "parameters", required = true) + private UrlSigningActionParameters parameters; + + /** + * 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(); + } + } +} 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..1c76bfdff3d9a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningActionParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the parameters for the Url Signing action. */ +@Fluent +public final class UrlSigningActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlSigningActionParameters.class); + + /* + * The @odata.type property. + */ + @JsonProperty(value = "@odata.type", required = true) + private String odataType; + + /* + * 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() { + odataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters"; + } + + /** + * Get the odataType property: The @odata.type property. + * + * @return the odataType value. + */ + public String odataType() { + return this.odataType; + } + + /** + * Set the odataType property: The @odata.type property. + * + * @param odataType the odataType value to set. + * @return the UrlSigningActionParameters object itself. + */ + public UrlSigningActionParameters withOdataType(String odataType) { + this.odataType = odataType; + 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..b88eb836de86c --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKey.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Url signing key. */ +@Fluent +public final class UrlSigningKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlSigningKey.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..32447e37b5fd6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningKeyParameters.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlSigningKeyParameters.class); + + /* + * 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 KV secret + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * Version of the secret to be used + */ + @JsonProperty(value = "secretVersion") + private String secretVersion; + + /** + * 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 KV secret. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: Resource reference to the KV secret. + * + * @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(); + } + } +} 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..354d29d758b9d --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UrlSigningParamIdentifier.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines how to identify a parameter for a specific purpose e.g. expires. */ +@Fluent +public final class UrlSigningParamIdentifier { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UrlSigningParamIdentifier.class); + + /* + * Indicates the purpose of the parameter + */ + @JsonProperty(value = "paramIndicator", required = true) + private ParamIndicator paramIndicator; + + /* + * Parameter name + */ + @JsonProperty(value = "paramName", required = true) + private String paramName; + + /** + * 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")); + } + } +} 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..61e83946eac1f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names. */ +@Fluent +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * 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; + + /** + * 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..25fb4502d3c82 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UsageUnit.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsageUnit. */ +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); + } + + /** @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..3a91331803e05 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cdn.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list usages operation response. */ +@Fluent +public final class UsagesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListResult.class); + + /* + * 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; + + /** + * 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/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..3989d31181201 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/UserManagedHttpsParameters.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserManagedHttpsParameters.class); + + /* + * Defines the certificate source parameters using user's keyvault + * certificate for enabling SSL. + */ + @JsonProperty(value = "certificateSourceParameters", required = true) + private KeyVaultCertificateSourceParameters certificateSourceParameters; + + /** + * 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(); + } + } +} 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..520ce89826e13 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateCustomDomainInput.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the custom domain to be validated for DNS mapping. */ +@Fluent +public final class ValidateCustomDomainInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateCustomDomainInput.class); + + /* + * The host name of the custom domain. Must be a domain name. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /** + * 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")); + } + } +} 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..a255810ece369 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateProbeInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the validate probe API. */ +@Fluent +public final class ValidateProbeInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateProbeInput.class); + + /* + * The probe URL to validate. + */ + @JsonProperty(value = "probeURL", required = true) + private String probeUrl; + + /** + * 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")); + } + } +} 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..12347ecce4a43 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input of the secret to be validated. */ +@Fluent +public final class ValidateSecretInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateSecretInput.class); + + /* + * The secret source. + */ + @JsonProperty(value = "secretSource", required = true) + private ResourceReference secretSource; + + /* + * The secret type. + */ + @JsonProperty(value = "secretType", required = true) + private ValidateSecretType secretType; + + /** + * Get the secretSource property: The secret source. + * + * @return the secretSource value. + */ + public ResourceReference secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: The secret source. + * + * @param secretSource the secretSource value to set. + * @return the ValidateSecretInput object itself. + */ + public ValidateSecretInput withSecretSource(ResourceReference secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Get the secretType property: The secret type. + * + * @return the secretType value. + */ + public ValidateSecretType 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(ValidateSecretType secretType) { + this.secretType = secretType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretSource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretSource in model ValidateSecretInput")); + } else { + secretSource().validate(); + } + if (secretType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property secretType in model ValidateSecretInput")); + } + } +} 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/ValidateSecretType.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretType.java new file mode 100644 index 0000000000000..524f60335fd07 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidateSecretType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ValidateSecretType. */ +public final class ValidateSecretType extends ExpandableStringEnum { + /** Static value UrlSigningKey for ValidateSecretType. */ + public static final ValidateSecretType URL_SIGNING_KEY = fromString("UrlSigningKey"); + + /** Static value ManagedCertificate for ValidateSecretType. */ + public static final ValidateSecretType MANAGED_CERTIFICATE = fromString("ManagedCertificate"); + + /** Static value CustomerCertificate for ValidateSecretType. */ + public static final ValidateSecretType CUSTOMER_CERTIFICATE = fromString("CustomerCertificate"); + + /** + * Creates or finds a ValidateSecretType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidateSecretType. + */ + @JsonCreator + public static ValidateSecretType fromString(String name) { + return fromString(name, ValidateSecretType.class); + } + + /** @return known ValidateSecretType values. */ + public static Collection values() { + return values(ValidateSecretType.class); + } +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Validates.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Validates.java new file mode 100644 index 0000000000000..b2a93e9db0ca4 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/Validates.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cdn.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Validates. */ +public interface Validates { + /** + * Validate a Secret in the profile. + * + * @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 secret(ValidateSecretInput validateSecretInput); + + /** + * Validate a Secret in the profile. + * + * @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. + */ + Response secretWithResponse(ValidateSecretInput validateSecretInput, Context context); +} diff --git a/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidationToken.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidationToken.java new file mode 100644 index 0000000000000..4685590c1511a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/ValidationToken.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.ValidationTokenInner; + +/** An immutable client-side representation of ValidationToken. */ +public interface ValidationToken { + /** + * Gets the token property: The token property. + * + * @return the token value. + */ + String token(); + + /** + * Gets the inner com.azure.resourcemanager.cdn.generated.fluent.models.ValidationTokenInner object. + * + * @return the inner object. + */ + ValidationTokenInner 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..88960e5effcd6 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafAction.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.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); + } + + /** @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..655cd1deeb568 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafGranularity.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.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); + } + + /** @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/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..a20e1f211fd06 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetric.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.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); + } + + /** @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/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..96fd0e98a9bec --- /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. + */ + WafMetricsResponseGranularity 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/WafMetricsResponseGranularity.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseGranularity.java new file mode 100644 index 0000000000000..fa40e77264c57 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseGranularity.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WafMetricsResponseGranularity. */ +public final class WafMetricsResponseGranularity extends ExpandableStringEnum { + /** Static value PT5M for WafMetricsResponseGranularity. */ + public static final WafMetricsResponseGranularity PT5M = fromString("PT5M"); + + /** Static value PT1H for WafMetricsResponseGranularity. */ + public static final WafMetricsResponseGranularity PT1H = fromString("PT1H"); + + /** Static value P1D for WafMetricsResponseGranularity. */ + public static final WafMetricsResponseGranularity P1D = fromString("P1D"); + + /** + * Creates or finds a WafMetricsResponseGranularity from its string representation. + * + * @param name a name to look for. + * @return the corresponding WafMetricsResponseGranularity. + */ + @JsonCreator + public static WafMetricsResponseGranularity fromString(String name) { + return fromString(name, WafMetricsResponseGranularity.class); + } + + /** @return known WafMetricsResponseGranularity values. */ + public static Collection values() { + return values(WafMetricsResponseGranularity.class); + } +} 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..aa9745553f8ec --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The WafMetricsResponseSeriesItem model. */ +@Fluent +public final class WafMetricsResponseSeriesItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WafMetricsResponseSeriesItem.class); + + /* + * The metric property. + */ + @JsonProperty(value = "metric") + private String metric; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private WafMetricsResponseSeriesItemUnit unit; + + /* + * The groups property. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The data property. + */ + @JsonProperty(value = "data") + private List data; + + /** + * 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 WafMetricsResponseSeriesItemUnit 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(WafMetricsResponseSeriesItemUnit 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/WafMetricsResponseSeriesItemUnit.java b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemUnit.java new file mode 100644 index 0000000000000..5baf32b9f21bb --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafMetricsResponseSeriesItemUnit.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for WafMetricsResponseSeriesItemUnit. */ +public enum WafMetricsResponseSeriesItemUnit { + /** Enum value count. */ + COUNT("count"); + + /** The actual serialized value for a WafMetricsResponseSeriesItemUnit instance. */ + private final String value; + + WafMetricsResponseSeriesItemUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WafMetricsResponseSeriesItemUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed WafMetricsResponseSeriesItemUnit object, or null if unable to parse. + */ + @JsonCreator + public static WafMetricsResponseSeriesItemUnit fromString(String value) { + WafMetricsResponseSeriesItemUnit[] items = WafMetricsResponseSeriesItemUnit.values(); + for (WafMetricsResponseSeriesItemUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @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/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..9374aad804464 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WafMetricsResponseSeriesPropertiesItemsItem model. */ +@Fluent +public final class WafMetricsResponseSeriesPropertiesItemsItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WafMetricsResponseSeriesPropertiesItemsItem.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /** + * 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/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..6db7deab4fe0a --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingGroupBy.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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); + } + + /** @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..af0dc802f5468 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingType.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.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 country for WafRankingType. */ + public static final WafRankingType COUNTRY = fromString("country"); + + /** 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); + } + + /** @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..d7accf6f7ea49 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRankingsResponseDataItem.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The WafRankingsResponseDataItem model. */ +@Fluent +public final class WafRankingsResponseDataItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WafRankingsResponseDataItem.class); + + /* + * The groupValues property. + */ + @JsonProperty(value = "groupValues") + private List groupValues; + + /* + * The metrics property. + */ + @JsonProperty(value = "metrics") + private List metrics; + + /** + * 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/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..e0c1e0691d507 --- /dev/null +++ b/sdk/cdn/azure-resourcemanager-cdn-generated/src/main/java/com/azure/resourcemanager/cdn/generated/models/WafRuleType.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.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); + } + + /** @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/ci.yml b/sdk/cdn/ci.yml new file mode 100644 index 0000000000000..8aa5cce60cea8 --- /dev/null +++ b/sdk/cdn/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: cdn + Artifacts: + - name: azure-resourcemanager-cdn-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercdngenerated diff --git a/sdk/cdn/pom.xml b/sdk/cdn/pom.xml new file mode 100644 index 0000000000000..61ac07fff5d67 --- /dev/null +++ b/sdk/cdn/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-cdn-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-cdn-generated + + + +